diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 08:22:54 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 08:22:54 +0000 |
commit | 6a414ffa82da567ae225bf5ec59acbf2022eb496 (patch) | |
tree | 81ad20ae2a52d84efe7663838a4ce15df6f9747f /chrome/browser/ui/browser_command_controller.cc | |
parent | e4e66f9438f65f57f229fd083b7e5f058d9881af (diff) | |
download | chromium_src-6a414ffa82da567ae225bf5ec59acbf2022eb496.zip chromium_src-6a414ffa82da567ae225bf5ec59acbf2022eb496.tar.gz chromium_src-6a414ffa82da567ae225bf5ec59acbf2022eb496.tar.bz2 |
Reland ash: Use immersive mode for fullscreen
* Remove immersive mode button from maximized window frame
* Tie immersive mode to browser-fullscreen only, keep tab-fullscreen
with existing UI
* Size button exits immersive mode
* Add ImageButton::GetImage for testing
* Most browser commands are enabled in immersive fullscreen
BUG=177549
TEST=added to browser_tests views_unittests ash_unittests
Original review: https://codereview.chromium.org/12316086/
Review URL: https://chromiumcodereview.appspot.com/12328119
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184908 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_command_controller.cc')
-rw-r--r-- | chrome/browser/ui/browser_command_controller.cc | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index a8ffedc..4eb144b 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -786,12 +786,9 @@ void BrowserCommandController::TabRestoreServiceDestroyed( //////////////////////////////////////////////////////////////////////////////// // BrowserCommandController, private: -bool BrowserCommandController::IsShowingMainUI(bool is_fullscreen) { -#if !defined(OS_MACOSX) - return browser_->is_type_tabbed() && !is_fullscreen; -#else - return browser_->is_type_tabbed(); -#endif +bool BrowserCommandController::IsShowingMainUI() { + bool should_hide_ui = window() && window()->ShouldHideUIForFullscreen(); + return browser_->is_type_tabbed() && !should_hide_ui; } void BrowserCommandController::InitCommandState() { @@ -973,9 +970,7 @@ void BrowserCommandController::UpdateSharedCommandsForIncognitoAvailability( void BrowserCommandController::UpdateCommandsForIncognitoAvailability() { UpdateSharedCommandsForIncognitoAvailability(&command_updater_, profile()); - const bool show_main_ui = - IsShowingMainUI(window() && window()->IsFullscreen()); - if (!show_main_ui) { + if (!IsShowingMainUI()) { command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, false); command_updater_.UpdateCommandEnabled(IDC_OPTIONS, false); } @@ -1072,12 +1067,10 @@ void BrowserCommandController::UpdateCommandsForBookmarkEditing() { } void BrowserCommandController::UpdateCommandsForBookmarkBar() { - const bool show_main_ui = - IsShowingMainUI(window() && window()->IsFullscreen()); command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, browser_defaults::bookmarks_enabled && !profile()->GetPrefs()->IsManagedPreference(prefs::kShowBookmarkBar) && - show_main_ui); + IsShowingMainUI()); } void BrowserCommandController::UpdateCommandsForFileSelectionDialogs() { @@ -1087,8 +1080,7 @@ void BrowserCommandController::UpdateCommandsForFileSelectionDialogs() { void BrowserCommandController::UpdateCommandsForFullscreenMode( FullScreenMode fullscreen_mode) { - const bool show_main_ui = - IsShowingMainUI(fullscreen_mode != FULLSCREEN_DISABLED); + bool show_main_ui = IsShowingMainUI(); bool main_not_fullscreen = show_main_ui && (fullscreen_mode == FULLSCREEN_DISABLED); @@ -1155,8 +1147,7 @@ void BrowserCommandController::UpdateCommandsForFullscreenMode( } void BrowserCommandController::UpdateCommandsForMultipleProfiles() { - bool show_main_ui = IsShowingMainUI(window() && window()->IsFullscreen()); - bool enable = show_main_ui && + bool enable = IsShowingMainUI() && !profile()->IsOffTheRecord() && profile_manager_ && AvatarMenuModel::ShouldShowAvatarMenu(); |