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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 1812013003: Pass shelf instances, not root windows, for ash context menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call OnShelfAlignmentChanged after LayoutShelf. Created 4 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/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 2509d478b9a7e3ba76d520a0287702d1e74d5f13..8b779fdac359535b74f058d4a4643bd7e77e63d8 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -247,21 +247,20 @@ bool ShelfLayoutManager::IsVisible() const {
state_.auto_hide_state == SHELF_AUTO_HIDE_SHOWN));
}
-bool ShelfLayoutManager::SetAlignment(ShelfAlignment alignment) {
+void ShelfLayoutManager::SetAlignment(ShelfAlignment alignment) {
if (alignment_ == alignment)
- return false;
+ return;
alignment_ = alignment;
// The shelf will itself move to the bottom while locked or obscured by user
// login. If a request is sent to move while being obscured, we postpone the
// move until the user session is resumed.
- if (IsAlignmentLocked())
- return false;
-
- // This should not be called during the lock screen transitions.
- shelf_->SetAlignment(alignment);
- LayoutShelf();
- return true;
+ if (!IsAlignmentLocked()) {
+ shelf_->SetAlignment(alignment);
+ LayoutShelf();
+ Shell::GetInstance()->OnShelfAlignmentChanged(
+ shelf_->GetNativeWindow()->GetRootWindow());
+ }
}
ShelfAlignment ShelfLayoutManager::GetAlignment() const {
@@ -296,11 +295,6 @@ void ShelfLayoutManager::LayoutShelf() {
ShelfVisibilityState ShelfLayoutManager::CalculateShelfVisibility() {
switch(auto_hide_behavior_) {
case SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS:
-#if defined(OS_WIN)
- // Disable shelf auto-hide behavior on screen sides in Metro mode.
- if (GetAlignment() != SHELF_ALIGNMENT_BOTTOM)
- return SHELF_VISIBLE;
-#endif
return SHELF_AUTO_HIDE;
case SHELF_AUTO_HIDE_BEHAVIOR_NEVER:
return SHELF_VISIBLE;
@@ -1149,6 +1143,8 @@ void ShelfLayoutManager::UpdateShelfVisibilityAfterLoginUIChange() {
shelf_->SetAlignment(GetAlignment());
UpdateVisibilityState();
LayoutShelf();
+ Shell::GetInstance()->OnShelfAlignmentChanged(
+ shelf_->GetNativeWindow()->GetRootWindow());
}
bool ShelfLayoutManager::IsAlignmentLocked() const {
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698