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

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

Issue 1743493002: Cleanup ash shelf accessor functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ShelfBrowserTest. 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
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 fdb6e0743a9e4061e62362cea2fcfda3c5cf66ea..0b8591622d8ee79ae488d19b03e5290c4f9acacd 100644
--- a/ash/wm/panels/panel_layout_manager.cc
+++ b/ash/wm/panels/panel_layout_manager.cc
@@ -311,8 +311,8 @@ void PanelLayoutManager::SetShelf(Shelf* shelf) {
DCHECK(!shelf_layout_manager_);
shelf_ = shelf;
shelf_->AddIconObserver(this);
- if (shelf_->shelf_widget()) {
- shelf_layout_manager_ = shelf_->shelf_widget()->shelf_layout_manager();
+ if (shelf_->shelf_layout_manager()) {
+ shelf_layout_manager_ = shelf_->shelf_layout_manager();
WillChangeVisibilityState(shelf_layout_manager_->visibility_state());
shelf_layout_manager_->AddObserver(this);
}
@@ -584,8 +584,7 @@ void PanelLayoutManager::MinimizePanel(aura::Window* panel) {
panel_slide_settings.SetTransitionDuration(
base::TimeDelta::FromMilliseconds(kPanelSlideDurationMilliseconds));
gfx::Rect bounds(panel->bounds());
- bounds.Offset(GetSlideInAnimationOffset(
- shelf_->shelf_widget()->GetAlignment()));
+ bounds.Offset(GetSlideInAnimationOffset(shelf_->alignment()));
SetChildBoundsDirect(panel, bounds);
panel->Hide();
layer->SetOpacity(0);
@@ -618,7 +617,7 @@ void PanelLayoutManager::Relayout() {
return;
base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true);
- ShelfAlignment alignment = shelf_->shelf_widget()->GetAlignment();
+ ShelfAlignment alignment = shelf_->alignment();
bool horizontal = alignment == SHELF_ALIGNMENT_TOP ||
alignment == SHELF_ALIGNMENT_BOTTOM;
gfx::Rect shelf_bounds = ash::ScreenUtil::ConvertRectFromScreen(

Powered by Google App Engine
This is Rietveld 408576698