Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2022)

Unified Diff: ash/launcher/launcher_context_menu.cc

Issue 10546024: Add RootWindowController (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash.gyp ('k') | ash/root_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher_context_menu.cc
diff --git a/ash/launcher/launcher_context_menu.cc b/ash/launcher/launcher_context_menu.cc
index 7b586ba6dcbb5fbf5b4183eb202b0d90401d0662..cb92a3b77c996c3263b2c017f612d5113a842e64 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;
}
« no previous file with comments | « ash/ash.gyp ('k') | ash/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698