Index: ash/root_window_controller.cc |
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
index 8ccdd12d7782e980252b054f83e70a7e2db49229..e3ca18578eced81aa90f8481f75ce8706e1fef75 100644 |
--- a/ash/root_window_controller.cc |
+++ b/ash/root_window_controller.cc |
@@ -176,14 +176,23 @@ RootWindowController::~RootWindowController() { |
} |
// static |
-internal::RootWindowController* |
-RootWindowController::ForLauncher(aura::Window* window) { |
+RootWindowController* RootWindowController::ForLauncher(aura::Window* window) { |
if (Shell::IsLauncherPerDisplayEnabled()) |
return GetRootWindowController(window->GetRootWindow()); |
else |
return Shell::GetPrimaryRootWindowController(); |
} |
+// static |
+RootWindowController* RootWindowController::ForWindow(aura::Window* window) { |
+ return GetRootWindowController(window->GetRootWindow()); |
+} |
+ |
+// static |
+RootWindowController* RootWindowController::ForActiveRootWindow() { |
+ return GetRootWindowController(Shell::GetActiveRootWindow()); |
+} |
+ |
void RootWindowController::Shutdown() { |
CloseChildWindows(); |
if (Shell::GetActiveRootWindow() == root_window_.get()) { |
@@ -221,7 +230,7 @@ RootWindowController::GetSystemModalLayoutManager(aura::Window* window) { |
container = GetContainer(kShellWindowId_SystemModalContainer); |
} |
} else { |
- user::LoginStatus login = Shell::GetInstance()->status_area_widget() ? |
+ user::LoginStatus login = Shell::GetInstance()->tray_delegate() ? |
Shell::GetInstance()->tray_delegate()->GetUserLoginStatus() : |
user::LOGGED_IN_NONE; |
int modal_window_id = (login == user::LOGGED_IN_LOCKED || |
@@ -442,6 +451,14 @@ void RootWindowController::MoveWindowsTo(aura::RootWindow* dst) { |
} |
} |
+SystemTray* RootWindowController::GetSystemTray() { |
+ // We assume in throughout the code that this will not return NULL. If code |
+ // triggers this for valid reasons, it should test status_area_widget first. |
+ internal::StatusAreaWidget* status_area = status_area_widget(); |
+ CHECK(status_area); |
+ return status_area->system_tray(); |
+} |
+ |
void RootWindowController::ShowContextMenu( |
const gfx::Point& location_in_screen) { |
aura::RootWindow* target = Shell::IsLauncherPerDisplayEnabled() ? |