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

Unified Diff: chrome/browser/ui/ash/chrome_launcher_prefs.cc

Issue 1839223003: Add basic Chrome interaction with the mash shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. 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
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 cc625879324c2ba8f9ebdc658511ddfdff07c5df..b437cd32af6eac8421c6805aa6d51d1223b42ece 100644
--- a/chrome/browser/ui/ash/chrome_launcher_prefs.cc
+++ b/chrome/browser/ui/ash/chrome_launcher_prefs.cc
@@ -77,4 +77,52 @@ base::DictionaryValue* CreateAppDict(const std::string& app_id) {
return app_value.release();
}
+ash::ShelfAlignment AlignmentFromPref(const std::string& value) {
+ if (value == ash::kShelfAlignmentLeft)
+ return ash::SHELF_ALIGNMENT_LEFT;
+ else if (value == ash::kShelfAlignmentRight)
+ return ash::SHELF_ALIGNMENT_RIGHT;
+ // Default to bottom.
+ return ash::SHELF_ALIGNMENT_BOTTOM;
+}
+
+const char* AlignmentToPref(ash::ShelfAlignment alignment) {
+ switch (alignment) {
+ case ash::SHELF_ALIGNMENT_BOTTOM:
+ return ash::kShelfAlignmentBottom;
+ case ash::SHELF_ALIGNMENT_LEFT:
+ return ash::kShelfAlignmentLeft;
+ case ash::SHELF_ALIGNMENT_RIGHT:
+ return ash::kShelfAlignmentRight;
+ }
+ NOTREACHED();
+ return nullptr;
+}
+
+ash::ShelfAutoHideBehavior AutoHideBehaviorFromPref(const std::string& value) {
+ // Note: To maintain sync compatibility with old images of chrome/chromeos
+ // the set of values that may be encountered includes the now-extinct
+ // "Default" as well as "Never" and "Always", "Default" should now
+ // be treated as "Never" (http://crbug.com/146773).
+ if (value == ash::kShelfAutoHideBehaviorAlways)
+ return ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
+ return ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER;
+}
+
+const char* AutoHideBehaviorToPref(ash::ShelfAutoHideBehavior behavior) {
+ switch (behavior) {
+ case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS:
+ return ash::kShelfAutoHideBehaviorAlways;
+ case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER:
+ return ash::kShelfAutoHideBehaviorNever;
+ case ash::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
+ // hide the shelf as part of an animation (e.g. the multi user change).
+ return nullptr;
+ }
+ NOTREACHED();
+ return nullptr;
+}
+
} // namespace ash
« no previous file with comments | « chrome/browser/ui/ash/chrome_launcher_prefs.h ('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