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

Unified Diff: chrome/browser/ui/ash/chrome_launcher_prefs.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/wm/window_animations.cc ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/chrome_launcher_prefs.cc
diff --git a/chrome/browser/ui/ash/chrome_launcher_prefs.cc b/chrome/browser/ui/ash/chrome_launcher_prefs.cc
index ee0a413852d811595fbe6f4880c2e7094a168332..c90b435fdbda5a30b5f36f31a2529324e675ba7f 100644
--- a/chrome/browser/ui/ash/chrome_launcher_prefs.cc
+++ b/chrome/browser/ui/ash/chrome_launcher_prefs.cc
@@ -132,6 +132,10 @@ const char* AlignmentToPref(ShelfAlignment alignment) {
return kShelfAlignmentLeft;
case SHELF_ALIGNMENT_RIGHT:
return kShelfAlignmentRight;
+ case SHELF_ALIGNMENT_BOTTOM_LOCKED:
+ // This should not be a valid preference option for now. We only want to
+ // lock the shelf during login or when adding a user.
+ return nullptr;
}
NOTREACHED();
return nullptr;
@@ -154,8 +158,8 @@ const char* AutoHideBehaviorToPref(ShelfAutoHideBehavior behavior) {
case SHELF_AUTO_HIDE_BEHAVIOR_NEVER:
return kShelfAutoHideBehaviorNever;
case SHELF_AUTO_HIDE_ALWAYS_HIDDEN:
- // This one should not be a valid preference option for now. We only want
- // to completely hide it when we run in app mode - or while we temporarily
+ // This should not be a valid preference option for now. We only want to
+ // completely hide it when we run in app mode - or while we temporarily
// hide the shelf as part of an animation (e.g. the multi user change).
return nullptr;
}
@@ -252,6 +256,9 @@ void SetShelfAlignmentPref(PrefService* prefs,
DCHECK_GE(display_id, 0);
const char* value = AlignmentToPref(alignment);
+ if (!value)
+ return;
+
SetPerDisplayPref(prefs, display_id, prefs::kShelfAlignment, value);
if (display_id == gfx::Screen::GetScreen()->GetPrimaryDisplay().id()) {
// See comment in |kShelfAlignment| as to why we consider two prefs.
« no previous file with comments | « ash/wm/window_animations.cc ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698