Chromium Code Reviews| 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..612adcfe1926e5e54da468bb4e0f0be923f4a143 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" |
| @@ -130,14 +131,12 @@ PanelLayoutManager::PanelLayoutManager(aura::Window* panel_container) |
| last_active_panel_(NULL), |
| weak_factory_(this) { |
| DCHECK(panel_container); |
| - aura::client::GetActivationClient(Shell::GetPrimaryRootWindow())-> |
| + aura::client::GetActivationClient(panel_container_->GetRootWindow())-> |
|
James Cook
2013/03/05 20:30:38
Is this part of the same patch? It looks OK but I'
Harry McCleave
2013/03/06 01:59:49
Done.
|
| AddObserver(this); |
| } |
| 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; |