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

Unified Diff: ash/shelf/shelf.cc

Issue 1877543002: Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update and cleanup tests. Created 4 years, 8 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/shelf/shelf.h ('k') | ash/shelf/shelf_bezel_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf.cc
diff --git a/ash/shelf/shelf.cc b/ash/shelf/shelf.cc
index 8d96506970a50dff103120bce9c370741bd1a1d3..0609d6dee1918386ce463f3fb1c08398aae81f46 100644
--- a/ash/shelf/shelf.cc
+++ b/ash/shelf/shelf.cc
@@ -42,12 +42,10 @@ const char Shelf::kNativeViewName[] = "ShelfView";
Shelf::Shelf(ShelfModel* shelf_model,
ShelfDelegate* shelf_delegate,
ShelfWidget* shelf_widget)
- : shelf_view_(nullptr),
- alignment_(SHELF_ALIGNMENT_BOTTOM),
- auto_hide_behavior_(SHELF_AUTO_HIDE_BEHAVIOR_NEVER),
- delegate_(shelf_delegate),
- shelf_widget_(shelf_widget) {
- shelf_view_ = new ShelfView(shelf_model, delegate_, this);
+ : delegate_(shelf_delegate),
+ shelf_widget_(shelf_widget),
+ shelf_view_(new ShelfView(shelf_model, delegate_, this)),
+ shelf_locking_manager_(this) {
shelf_view_->Init();
shelf_widget_->GetContentsView()->AddChildView(shelf_view_);
shelf_widget_->GetNativeView()->SetName(kNativeViewName);
@@ -81,14 +79,8 @@ void Shelf::SetAlignment(ShelfAlignment alignment) {
// ShelfLayoutManager will resize the shelf.
}
-ShelfAlignment Shelf::GetAlignment() const {
- // Bottom alignment is forced when the screen is locked or a user gets added.
- bool locked = shelf_widget_->shelf_layout_manager()->IsAlignmentLocked();
- return locked ? SHELF_ALIGNMENT_BOTTOM : alignment_;
-}
-
bool Shelf::IsHorizontalAlignment() const {
- return alignment_ == SHELF_ALIGNMENT_BOTTOM;
+ return ash::IsHorizontalAlignment(alignment_);
}
void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) {
« no previous file with comments | « ash/shelf/shelf.h ('k') | ash/shelf/shelf_bezel_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698