Index: ash/wm/panel_layout_manager.cc |
diff --git a/ash/wm/panel_layout_manager.cc b/ash/wm/panel_layout_manager.cc |
index 54df0c29dae1efc4c3df52235e44e363ed2040d0..60e47ef8f432d1fb6f0e685e70b00e8102e0f4c0 100644 |
--- a/ash/wm/panel_layout_manager.cc |
+++ b/ash/wm/panel_layout_manager.cc |
@@ -9,6 +9,7 @@ |
#include "ash/launcher/launcher.h" |
#include "ash/screen_ash.h" |
+#include "ash/shelf/shelf_widget.h" |
#include "ash/shell.h" |
#include "ash/wm/frame_painter.h" |
#include "ash/wm/property_util.h" |
@@ -136,8 +137,6 @@ PanelLayoutManager::PanelLayoutManager(aura::Window* panel_container) |
PanelLayoutManager::~PanelLayoutManager() { |
Shutdown(); |
- if (launcher_) |
- launcher_->RemoveIconObserver(this); |
aura::client::GetActivationClient(Shell::GetPrimaryRootWindow())-> |
RemoveObserver(this); |
} |
@@ -148,6 +147,9 @@ void PanelLayoutManager::Shutdown() { |
delete iter->callout_widget; |
} |
panel_windows_.clear(); |
+ if (launcher_) |
+ launcher_->RemoveIconObserver(this); |
+ launcher_ = NULL; |
} |
void PanelLayoutManager::StartDragging(aura::Window* panel) { |
@@ -322,14 +324,14 @@ void PanelLayoutManager::RestorePanel(aura::Window* panel) { |
} |
void PanelLayoutManager::Relayout() { |
- if (!launcher_ || !launcher_->widget()) |
+ if (!launcher_ || !launcher_->shelf_widget()) |
return; |
if (in_layout_) |
return; |
base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); |
- int launcher_top = launcher_->widget()->GetWindowBoundsInScreen().y(); |
+ int launcher_top = launcher_->shelf_widget()->GetWindowBoundsInScreen().y(); |
int panel_left_bounds = kPanelIdealSpacing; |
int panel_right_bounds = |
panel_container_->bounds().width() - kPanelIdealSpacing; |