diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 08:22:07 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 08:22:07 +0000 |
commit | cea6a7a50ba053db6a4eb7371fbd601ef2859eb8 (patch) | |
tree | 18407c58a4eea2376e4fc072a1a47bfe504559a1 /ash/launcher | |
parent | 4b9bb8720e70a24a5320a6b4df88801bb612b94c (diff) | |
download | chromium_src-cea6a7a50ba053db6a4eb7371fbd601ef2859eb8.zip chromium_src-cea6a7a50ba053db6a4eb7371fbd601ef2859eb8.tar.gz chromium_src-cea6a7a50ba053db6a4eb7371fbd601ef2859eb8.tar.bz2 |
Add RootWindowController that keeps per root window state.
Cleanup Shell::Init(). Separated initialization that are specific to shell, root window and primary display.
I also did small cleanup in detor. I'll do more cleanups when I have a chance.
BUG=123160
TEST=no functional change. all tests should pass.
Review URL: https://chromiumcodereview.appspot.com/10546024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141871 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher')
-rw-r--r-- | ash/launcher/launcher_context_menu.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ash/launcher/launcher_context_menu.cc b/ash/launcher/launcher_context_menu.cc index 7b586ba..cb92a3b 100644 --- a/ash/launcher/launcher_context_menu.cc +++ b/ash/launcher/launcher_context_menu.cc @@ -4,6 +4,7 @@ #include "ash/launcher/launcher_context_menu.h" +#include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/wm/shelf_auto_hide_behavior.h" #include "grit/ash_strings.h" @@ -24,21 +25,21 @@ LauncherContextMenu::~LauncherContextMenu() { // static bool LauncherContextMenu::IsAutoHideMenuHideChecked() { - ash::Shell* shell = ash::Shell::GetInstance(); + internal::RootWindowController* controller = + Shell::GetPrimaryRootWindowController(); ash::ShelfAutoHideBehavior auto_hide_behavior = - shell->GetShelfAutoHideBehavior(); - return (shell->IsInMaximizedMode() && + Shell::GetInstance()->GetShelfAutoHideBehavior(); + return (controller->IsInMaximizedMode() && (auto_hide_behavior == ash::SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT || auto_hide_behavior == ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS)) || - (!shell->IsInMaximizedMode() && + (!controller->IsInMaximizedMode() && auto_hide_behavior == ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); } // static ShelfAutoHideBehavior LauncherContextMenu::GetToggledAutoHideBehavior() { - ash::Shell* shell = ash::Shell::GetInstance(); ash::ShelfAutoHideBehavior auto_hide_behavior; - if (shell->IsInMaximizedMode()) { + if (Shell::GetPrimaryRootWindowController()->IsInMaximizedMode()) { if (IsAutoHideMenuHideChecked()) auto_hide_behavior = ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER; else @@ -53,7 +54,7 @@ ShelfAutoHideBehavior LauncherContextMenu::GetToggledAutoHideBehavior() { // static int LauncherContextMenu::GetAutoHideResourceStringId() { - return ash::Shell::GetInstance()->IsInMaximizedMode() ? + return Shell::GetPrimaryRootWindowController()->IsInMaximizedMode() ? IDS_AURA_LAUNCHER_CONTEXT_MENU_AUTO_HIDE_MAXIMIZED : IDS_AURA_LAUNCHER_CONTEXT_MENU_AUTO_HIDE_NOT_MAXIMIZED; } |