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

Unified Diff: ash/wm/panels/panel_layout_manager.cc

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: safer shutdown (status_area_widget_) Created 7 years, 9 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/wm/maximize_bubble_controller.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panels/panel_layout_manager.cc
diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc
index cd612e8aeaeaad5081ed89e0dff184806eddf0b1..433f89476eca2257e6bc04bd100ed4950a7014c8 100644
--- a/ash/wm/panels/panel_layout_manager.cc
+++ b/ash/wm/panels/panel_layout_manager.cc
@@ -9,7 +9,8 @@
#include "ash/launcher/launcher.h"
#include "ash/screen_ash.h"
-#include "ash/shelf_types.h"
+#include "ash/shelf/shelf_types.h"
+#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/wm/frame_painter.h"
#include "ash/wm/property_util.h"
@@ -218,8 +219,6 @@ PanelLayoutManager::PanelLayoutManager(aura::Window* panel_container)
PanelLayoutManager::~PanelLayoutManager() {
Shutdown();
- if (launcher_)
- launcher_->RemoveIconObserver(this);
aura::client::GetActivationClient(Shell::GetPrimaryRootWindow())->
RemoveObserver(this);
Shell::GetInstance()->RemoveShellObserver(this);
@@ -231,6 +230,9 @@ void PanelLayoutManager::Shutdown() {
delete iter->callout_widget;
}
panel_windows_.clear();
+ if (launcher_)
+ launcher_->RemoveIconObserver(this);
+ launcher_ = NULL;
}
void PanelLayoutManager::StartDragging(aura::Window* panel) {
@@ -414,17 +416,18 @@ 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);
- ShelfAlignment alignment = launcher_->alignment();
+ ShelfAlignment alignment = launcher_->shelf_widget()->GetAlignment();
bool horizontal = alignment == SHELF_ALIGNMENT_TOP ||
alignment == SHELF_ALIGNMENT_BOTTOM;
- gfx::Rect launcher_bounds = launcher_->widget()->GetWindowBoundsInScreen();
+ gfx::Rect launcher_bounds = launcher_->shelf_widget()->
+ GetWindowBoundsInScreen();
int panel_start_bounds = kPanelIdealSpacing;
int panel_end_bounds = horizontal ?
panel_container_->bounds().width() - kPanelIdealSpacing :
« no previous file with comments | « ash/wm/maximize_bubble_controller.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698