[Mac] Remove extraneous Bookmarks menu from menu bar when running apps from launcher.
[Mac] Remove extraneous Bookmarks menu from menu bar when running apps from launcher.

When Chrome is closed, opening a bookmark app from the app launcher on
Mac leads to an additional Bookmarks menu appearing on the left of the
Mac menu bar. The issue only manifests itself under these exact
circumstances.

The problem appears to be caused by a bug in AppKit. Calling setSubmenu
on a *hidden* NSMenuItem with a *different* NSMenu to the current
submenu leads to the NSMenuItem becoming non-hidden. This precise
situation occurs when caching the bookmark menu on Mac, which is done to
improve profile switching performance.

This CL removes the extra Bookmarks menu by saving the hidden state of
the menu prior to caching, setting the menu to be visible, allowing the
existing caching to run, and then resetting the hidden state once
caching is complete. It is insufficient to skip setting the menu to be
visible in this process.

BUG=497813

Review URL: https://codereview.chromium.org/1308983009

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#347819}

axinging/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,Chilledheart/chromium,Chilledheart/chromium,Chilledheart/chromium