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

Unified Diff: ash/shell.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/shell.h ('k') | ash/shell/context_menu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 6949d6c049454479fdf10c2f4a173303eecaf4dc..71231a211d76645bb7a99960228374eda8f10a10 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -523,17 +523,19 @@ ShelfAutoHideBehavior Shell::GetShelfAutoHideBehavior(
void Shell::SetShelfAlignment(ShelfAlignment alignment,
aura::Window* root_window) {
ShelfWidget* shelf_widget = GetRootWindowController(root_window)->shelf();
- if (shelf_widget->shelf_layout_manager()->SetAlignment(alignment)) {
- FOR_EACH_OBSERVER(
- ShellObserver, observers_, OnShelfAlignmentChanged(root_window));
- }
+ shelf_widget->shelf_layout_manager()->SetAlignment(alignment);
}
-ShelfAlignment Shell::GetShelfAlignment(const aura::Window* root_window) {
+ShelfAlignment Shell::GetShelfAlignment(const aura::Window* root_window) const {
ShelfWidget* shelf_widget = GetRootWindowController(root_window)->shelf();
return shelf_widget->shelf_layout_manager()->GetAlignment();
}
+void Shell::OnShelfAlignmentChanged(aura::Window* root_window) {
+ FOR_EACH_OBSERVER(ShellObserver, observers_,
+ OnShelfAlignmentChanged(root_window));
+}
+
void Shell::NotifyFullscreenStateChange(bool is_fullscreen,
aura::Window* root_window) {
FOR_EACH_OBSERVER(ShellObserver, observers_, OnFullscreenStateChanged(
« no previous file with comments | « ash/shell.h ('k') | ash/shell/context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698