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

Unified Diff: ash/common/shelf/shelf_widget.cc

Issue 2676673005: ash: Clean up shelf GetAlignment() and IsHorizontalAlignment() calls (Closed)
Patch Set: Created 3 years, 11 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/common/shelf/shelf_widget.h ('k') | ash/common/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/common/shelf/shelf_widget.cc
diff --git a/ash/common/shelf/shelf_widget.cc b/ash/common/shelf/shelf_widget.cc
index d735e5897c17a0ddbd815142ed7698def34e053b..467bcc23a3b4a61922a08d9998a812f7f933e06b 100644
--- a/ash/common/shelf/shelf_widget.cc
+++ b/ash/common/shelf/shelf_widget.cc
@@ -220,6 +220,7 @@ ShelfWidget::ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf)
shelf_view_(nullptr),
background_animator_(SHELF_BACKGROUND_DEFAULT, wm_shelf_),
activating_as_fallback_(false) {
+ DCHECK(wm_shelf_);
background_animator_.AddObserver(this);
background_animator_.AddObserver(delegate_view_);
@@ -304,13 +305,10 @@ bool ShelfWidget::IsShelfHiddenBehindBlackBar() const {
return delegate_view_->opaque_foreground()->GetTargetOpacity() != 0.0f;
}
-ShelfAlignment ShelfWidget::GetAlignment() const {
- return wm_shelf_->GetAlignment();
-}
-
void ShelfWidget::OnShelfAlignmentChanged() {
shelf_view_->OnShelfAlignmentChanged();
- status_area_widget_->SetShelfAlignment(GetAlignment());
+ // TODO(jamescook): Status area should not cache alignment.
+ status_area_widget_->SetShelfAlignment(wm_shelf_->GetAlignment());
delegate_view_->SchedulePaint();
}
« no previous file with comments | « ash/common/shelf/shelf_widget.h ('k') | ash/common/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698