diff options
author | jackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-23 12:36:37 +0000 |
---|---|---|
committer | jackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-23 12:36:37 +0000 |
commit | 2ad128b25aa93665503d345bbfd1638dfcf279dc (patch) | |
tree | bb165c69f45ce8642d0eec6125c7f59e135ecda4 /apps/app_shim | |
parent | 6d6a51167a173c16a6095c448cbee7e4633b9e15 (diff) | |
download | chromium_src-2ad128b25aa93665503d345bbfd1638dfcf279dc.zip chromium_src-2ad128b25aa93665503d345bbfd1638dfcf279dc.tar.gz chromium_src-2ad128b25aa93665503d345bbfd1638dfcf279dc.tar.bz2 |
Reduce the transitions between the Chrome main menu and an app's main menu.
Currently the Chrome menu flashes briefly when switching between apps.
This is because the menu is changed to an app main menu when an app
window becomes main, and restored when it resigns main. In this CL, the
menu is changed when an app windows becomes main, and restored only when
a non-app window becomes main, or when the last app window closes.
This CL also adds empty File, Edit, and Window menus to the shim, so
that, when activating the shim, the transition to Chrome via the shim
is smoother.
BUG=168080
TEST=Start two apps.
Switch between the apps by clicking their icons in the dock.
The Chrome main menu should not flash briefly in the transition.
Review URL: https://chromiumcodereview.appspot.com/23551015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/app_shim')
-rw-r--r-- | apps/app_shim/chrome_main_app_mode_mac.mm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/app_shim/chrome_main_app_mode_mac.mm b/apps/app_shim/chrome_main_app_mode_mac.mm index 6dca6b7..18917f8 100644 --- a/apps/app_shim/chrome_main_app_mode_mac.mm +++ b/apps/app_shim/chrome_main_app_mode_mac.mm @@ -228,6 +228,19 @@ void AppShimController::SetUpMenu() { action:@selector(terminate:) keyEquivalent:@"q"]; + // Add File, Edit, and Window menus. These are just here to make the + // transition smoother, i.e. from another application to the shim then to + // Chrome. + [main_menu addItemWithTitle:l10n_util::GetNSString(IDS_FILE_MENU_MAC) + action:nil + keyEquivalent:@""]; + [main_menu addItemWithTitle:l10n_util::GetNSString(IDS_EDIT_MENU_MAC) + action:nil + keyEquivalent:@""]; + [main_menu addItemWithTitle:l10n_util::GetNSString(IDS_WINDOW_MENU_MAC) + action:nil + keyEquivalent:@""]; + [NSApp setMainMenu:main_menu]; } |