OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" | 5 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 return apps.release(); | 28 return apps.release(); |
29 } | 29 } |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 namespace ash { | 33 namespace ash { |
34 | 34 |
35 const char kPinnedAppsPrefAppIDPath[] = "id"; | 35 const char kPinnedAppsPrefAppIDPath[] = "id"; |
36 | 36 |
37 const char kShelfAutoHideBehaviorAlways[] = "Always"; | 37 const char kShelfAutoHideBehaviorAlways[] = "Always"; |
38 const char kShelfAutoHideBehaviorDefault[] = "Default"; | |
39 const char kShelfAutoHideBehaviorNever[] = "Never"; | 38 const char kShelfAutoHideBehaviorNever[] = "Never"; |
40 | 39 |
41 extern const char kShelfAlignmentBottom[] = "Bottom"; | 40 extern const char kShelfAlignmentBottom[] = "Bottom"; |
42 extern const char kShelfAlignmentLeft[] = "Left"; | 41 extern const char kShelfAlignmentLeft[] = "Left"; |
43 extern const char kShelfAlignmentRight[] = "Right"; | 42 extern const char kShelfAlignmentRight[] = "Right"; |
44 | 43 |
45 void RegisterChromeLauncherUserPrefs(PrefService* user_prefs) { | 44 void RegisterChromeLauncherUserPrefs(PrefService* user_prefs) { |
46 // TODO: If we want to support multiple profiles this will likely need to be | 45 // TODO: If we want to support multiple profiles this will likely need to be |
47 // pushed to local state and we'll need to track profile per item. | 46 // pushed to local state and we'll need to track profile per item. |
48 user_prefs->RegisterBooleanPref(prefs::kUseDefaultPinnedApps, | 47 user_prefs->RegisterBooleanPref(prefs::kUseDefaultPinnedApps, |
49 true, | 48 true, |
50 PrefService::SYNCABLE_PREF); | 49 PrefService::SYNCABLE_PREF); |
51 user_prefs->RegisterListPref(prefs::kPinnedLauncherApps, | 50 user_prefs->RegisterListPref(prefs::kPinnedLauncherApps, |
52 CreateDefaultPinnedAppsList(), | 51 CreateDefaultPinnedAppsList(), |
53 PrefService::SYNCABLE_PREF); | 52 PrefService::SYNCABLE_PREF); |
54 user_prefs->RegisterStringPref(prefs::kShelfAutoHideBehavior, | 53 user_prefs->RegisterStringPref(prefs::kShelfAutoHideBehavior, |
55 kShelfAutoHideBehaviorDefault, | 54 kShelfAutoHideBehaviorNever, |
56 PrefService::SYNCABLE_PREF); | 55 PrefService::SYNCABLE_PREF); |
57 user_prefs->RegisterStringPref(prefs::kShelfAlignment, | 56 user_prefs->RegisterStringPref(prefs::kShelfAlignment, |
58 kShelfAlignmentBottom, | 57 kShelfAlignmentBottom, |
59 PrefService::SYNCABLE_PREF); | 58 PrefService::SYNCABLE_PREF); |
60 user_prefs->RegisterBooleanPref(prefs::kLauncherShouldRunSyncAnimation, | 59 user_prefs->RegisterBooleanPref(prefs::kLauncherShouldRunSyncAnimation, |
61 true, | 60 true, |
62 PrefService::UNSYNCABLE_PREF); | 61 PrefService::UNSYNCABLE_PREF); |
63 } | 62 } |
64 | 63 |
65 base::DictionaryValue* CreateAppDict(const std::string& app_id) { | 64 base::DictionaryValue* CreateAppDict(const std::string& app_id) { |
66 scoped_ptr<base::DictionaryValue> app_value(new base::DictionaryValue); | 65 scoped_ptr<base::DictionaryValue> app_value(new base::DictionaryValue); |
67 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id); | 66 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id); |
68 return app_value.release(); | 67 return app_value.release(); |
69 } | 68 } |
70 | 69 |
71 } // namespace ash | 70 } // namespace ash |
OLD | NEW |