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

Unified Diff: ash/wm/dock/docked_window_layout_manager.cc

Issue 1743493002: Cleanup ash shelf accessor functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ash/shelf/shelf_widget.cc for browser_tests crash... Created 4 years, 10 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/app_list_controller.cc ('k') | ash/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/dock/docked_window_layout_manager.cc
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
index f010910a999bf30d8ddece814b85aeec3c9a6b97..517a4d243d7b8b15d570d1289bdf4920fa42f276 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -425,10 +425,8 @@ DockedWindowLayoutManager::~DockedWindowLayoutManager() {
}
void DockedWindowLayoutManager::Shutdown() {
- if (shelf_ && shelf_->shelf_widget()) {
- ShelfLayoutManager* shelf_layout_manager =
- shelf_->shelf_widget()->shelf_layout_manager();
- shelf_layout_manager->RemoveObserver(this);
+ if (shelf_ && shelf_->shelf_layout_manager()) {
+ shelf_->shelf_layout_manager()->RemoveObserver(this);
shelf_observer_.reset();
}
shelf_ = NULL;
@@ -539,10 +537,8 @@ void DockedWindowLayoutManager::FinishDragging(DockedAction action,
void DockedWindowLayoutManager::SetShelf(Shelf* shelf) {
DCHECK(!shelf_);
shelf_ = shelf;
- if (shelf_->shelf_widget()) {
- ShelfLayoutManager* shelf_layout_manager =
- shelf_->shelf_widget()->shelf_layout_manager();
- shelf_layout_manager->AddObserver(this);
+ if (shelf_->shelf_layout_manager()) {
+ shelf_->shelf_layout_manager()->AddObserver(this);
shelf_observer_.reset(new ShelfWindowObserver(this));
}
}
@@ -755,8 +751,7 @@ void DockedWindowLayoutManager::SetChildBounds(
if (IsPopupOrTransient(child))
return;
// Whenever one of our windows is moved or resized enforce layout.
- ShelfLayoutManager* shelf_layout =
- shelf_->shelf_widget()->shelf_layout_manager();
+ ShelfLayoutManager* shelf_layout = shelf_->shelf_layout_manager();
if (shelf_layout)
shelf_layout->UpdateVisibilityState();
}
@@ -807,15 +802,12 @@ void DockedWindowLayoutManager::OnShelfAlignmentChanged(
if (dock_container_->GetRootWindow() != root_window)
return;
- if (!shelf_ || !shelf_->shelf_widget())
- return;
-
- if (alignment_ == DOCKED_ALIGNMENT_NONE)
+ if (!shelf_ || alignment_ == DOCKED_ALIGNMENT_NONE)
return;
// Do not allow shelf and dock on the same side. Switch side that
// the dock is attached to and move all dock windows to that new side.
- ShelfAlignment shelf_alignment = shelf_->shelf_widget()->GetAlignment();
+ ShelfAlignment shelf_alignment = shelf_->alignment();
if (alignment_ == DOCKED_ALIGNMENT_LEFT &&
shelf_alignment == SHELF_ALIGNMENT_LEFT) {
alignment_ = DOCKED_ALIGNMENT_RIGHT;
« no previous file with comments | « ash/wm/app_list_controller.cc ('k') | ash/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698