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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.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
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
index aaf46c231ed0cc96cf6bab858475091e00d6f4f5..b7ab64bd4d38d677ded52cee8b093b6e295f1e1d 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -1021,34 +1021,6 @@ Profile* ChromeLauncherController::profile() {
return profile_;
}
-ash::ShelfAutoHideBehavior ChromeLauncherController::GetShelfAutoHideBehavior(
- aura::Window* root_window) const {
- return GetShelfAutoHideBehaviorFromPrefs(profile_, root_window);
-}
-
-bool ChromeLauncherController::CanUserModifyShelfAutoHideBehavior(
- aura::Window* root_window) const {
-#if defined(OS_WIN)
- // Disable shelf auto-hide behavior on screen sides in Metro mode.
- if (ash::Shell::GetInstance()->GetShelfAlignment(root_window) !=
- ash::SHELF_ALIGNMENT_BOTTOM) {
- return false;
- }
-#endif
- return profile_->GetPrefs()->
- FindPreference(prefs::kShelfAutoHideBehaviorLocal)->IsUserModifiable();
-}
-
-void ChromeLauncherController::ToggleShelfAutoHideBehavior(
- aura::Window* root_window) {
- ash::ShelfAutoHideBehavior behavior = GetShelfAutoHideBehavior(root_window) ==
- ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ?
- ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER :
- ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
- SetShelfAutoHideBehaviorPrefs(behavior, root_window);
- return;
-}
-
void ChromeLauncherController::UpdateAppState(content::WebContents* contents,
AppState app_state) {
std::string app_id = app_tab_helper_->GetAppID(contents);
@@ -1836,11 +1808,9 @@ void ChromeLauncherController::SetShelfAutoHideBehaviorPrefs(
void ChromeLauncherController::SetShelfAutoHideBehaviorFromPrefs() {
aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows();
-
- for (aura::Window::Windows::const_iterator iter = root_windows.begin();
- iter != root_windows.end(); ++iter) {
+ for (auto i = root_windows.begin(); i != root_windows.end(); ++i) {
ash::Shell::GetInstance()->SetShelfAutoHideBehavior(
- GetShelfAutoHideBehavior(*iter), *iter);
+ GetShelfAutoHideBehaviorFromPrefs(profile_, *i), *i);
}
}
@@ -1849,11 +1819,9 @@ void ChromeLauncherController::SetShelfAlignmentFromPrefs() {
return;
aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows();
-
- for (aura::Window::Windows::const_iterator iter = root_windows.begin();
- iter != root_windows.end(); ++iter) {
+ for (auto i = root_windows.begin(); i != root_windows.end(); ++i) {
ash::Shell::GetInstance()->SetShelfAlignment(
- GetShelfAlignmentFromPrefs(profile_, *iter), *iter);
+ GetShelfAlignmentFromPrefs(profile_, *i), *i);
}
}
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller.h ('k') | chrome/browser/ui/ash/launcher/launcher_context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698