Index: ash/wm/shelf_layout_manager.cc |
diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc |
index 75a53b7d6526de8ffae240049847e211174f6d21..582f4b0007f716294a1e3cbbd63da4b972982c2e 100644 |
--- a/ash/wm/shelf_layout_manager.cc |
+++ b/ash/wm/shelf_layout_manager.cc |
@@ -9,6 +9,7 @@ |
#include "ash/ash_switches.h" |
#include "ash/launcher/launcher.h" |
+#include "ash/root_window_controller.h" |
#include "ash/screen_ash.h" |
#include "ash/shell.h" |
#include "ash/shell_delegate.h" |
@@ -231,9 +232,9 @@ bool ShelfLayoutManager::SetAlignment(ShelfAlignment alignment) { |
if (launcher_) |
launcher_->SetAlignment(alignment); |
StatusAreaWidget* status_area_widget = |
sky
2012/10/17 16:25:20
Change this class to take the statusareawidget as
oshima
2012/10/17 17:49:43
Done.
|
- Shell::GetInstance()->status_area_widget(); |
+ RootWindowController::ForLauncher(root_window_)->status_area_widget(); |
if (status_area_widget) |
- Shell::GetInstance()->status_area_widget()->SetShelfAlignment(alignment); |
+ status_area_widget->SetShelfAlignment(alignment); |
LayoutShelf(); |
return true; |
} |
@@ -817,7 +818,7 @@ void ShelfLayoutManager::UpdateShelfBackground( |
// The status area normally draws a background, but we don't want it to draw a |
// background when the launcher does or when we're at login/lock screen. |
StatusAreaWidget* status_area_widget = |
- Shell::GetInstance()->status_area_widget(); |
+ RootWindowController::ForLauncher(root_window_)->status_area_widget(); |
if (status_area_widget) { |
ShellDelegate* delegate = Shell::GetInstance()->delegate(); |
bool delegate_allows_tray_bg = !delegate || |
@@ -849,8 +850,10 @@ ShelfLayoutManager::AutoHideState ShelfLayoutManager::CalculateAutoHideState( |
if (shell->GetAppListTargetVisibility()) |
return AUTO_HIDE_SHOWN; |
- if (shell->status_area_widget() && |
- shell->status_area_widget()->ShouldShowLauncher()) |
+ StatusAreaWidget* status_area_widget = |
+ RootWindowController::ForLauncher(root_window_)->status_area_widget(); |
+ |
+ if (status_area_widget && status_area_widget->ShouldShowLauncher()) |
return AUTO_HIDE_SHOWN; |
if (launcher_ && launcher_->IsShowingMenu()) |
@@ -867,8 +870,8 @@ ShelfLayoutManager::AutoHideState ShelfLayoutManager::CalculateAutoHideState( |
return AUTO_HIDE_HIDDEN; |
gfx::Rect shelf_region = launcher_widget()->GetWindowBoundsInScreen(); |
- if (shell->status_area_widget() && |
- shell->status_area_widget()->IsMessageBubbleShown() && |
+ if (status_area_widget && |
+ status_area_widget->IsMessageBubbleShown() && |
IsVisible()) { |
// Increase the the hit test area to prevent the shelf from disappearing |
// when the mouse is over the bubble gap. |