| 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_registry_syncable.h" |
| 11 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 // App ID of default pinned apps. | 15 // App ID of default pinned apps. |
| 16 const char* kDefaultPinnedApps[] = { | 16 const char* kDefaultPinnedApps[] = { |
| 17 "pjkljhegncpnkpknbcohdijeoejaedia", // Gmail | 17 "pjkljhegncpnkpknbcohdijeoejaedia", // Gmail |
| 18 "coobgpohoikkiipiblmjeljniedjpjpf", // Search | 18 "coobgpohoikkiipiblmjeljniedjpjpf", // Search |
| 19 "apdfllckaahabafndbhieahigkjlhalf", // Doc | 19 "apdfllckaahabafndbhieahigkjlhalf", // Doc |
| 20 "blpcfgokakmgnkcojhhkbfbldkacnbeo", // YouTube | 20 "blpcfgokakmgnkcojhhkbfbldkacnbeo", // YouTube |
| (...skipping 14 matching lines...) Expand all Loading... |
| 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 kShelfAutoHideBehaviorNever[] = "Never"; | 38 const char kShelfAutoHideBehaviorNever[] = "Never"; |
| 39 | 39 |
| 40 extern const char kShelfAlignmentBottom[] = "Bottom"; | 40 extern const char kShelfAlignmentBottom[] = "Bottom"; |
| 41 extern const char kShelfAlignmentLeft[] = "Left"; | 41 extern const char kShelfAlignmentLeft[] = "Left"; |
| 42 extern const char kShelfAlignmentRight[] = "Right"; | 42 extern const char kShelfAlignmentRight[] = "Right"; |
| 43 extern const char kShelfAlignmentTop[] = "Top"; | 43 extern const char kShelfAlignmentTop[] = "Top"; |
| 44 | 44 |
| 45 void RegisterChromeLauncherUserPrefs(PrefServiceSyncable* user_prefs) { | 45 void RegisterChromeLauncherUserPrefs(PrefRegistrySyncable* registry) { |
| 46 // TODO: If we want to support multiple profiles this will likely need to be | 46 // 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. | 47 // pushed to local state and we'll need to track profile per item. |
| 48 user_prefs->RegisterListPref(prefs::kPinnedLauncherApps, | 48 registry->RegisterListPref(prefs::kPinnedLauncherApps, |
| 49 CreateDefaultPinnedAppsList(), | 49 CreateDefaultPinnedAppsList(), |
| 50 PrefServiceSyncable::SYNCABLE_PREF); | 50 PrefRegistrySyncable::SYNCABLE_PREF); |
| 51 user_prefs->RegisterStringPref(prefs::kShelfAutoHideBehavior, | 51 registry->RegisterStringPref(prefs::kShelfAutoHideBehavior, |
| 52 kShelfAutoHideBehaviorNever, | 52 kShelfAutoHideBehaviorNever, |
| 53 PrefServiceSyncable::SYNCABLE_PREF); | 53 PrefRegistrySyncable::SYNCABLE_PREF); |
| 54 user_prefs->RegisterStringPref(prefs::kShelfAutoHideBehaviorLocal, | 54 registry->RegisterStringPref(prefs::kShelfAutoHideBehaviorLocal, |
| 55 std::string(), | 55 std::string(), |
| 56 PrefServiceSyncable::UNSYNCABLE_PREF); | 56 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 57 user_prefs->RegisterStringPref(prefs::kShelfAlignment, | 57 registry->RegisterStringPref(prefs::kShelfAlignment, |
| 58 kShelfAlignmentBottom, | 58 kShelfAlignmentBottom, |
| 59 PrefServiceSyncable::SYNCABLE_PREF); | 59 PrefRegistrySyncable::SYNCABLE_PREF); |
| 60 user_prefs->RegisterStringPref(prefs::kShelfAlignmentLocal, | 60 registry->RegisterStringPref(prefs::kShelfAlignmentLocal, |
| 61 std::string(), | 61 std::string(), |
| 62 PrefServiceSyncable::UNSYNCABLE_PREF); | 62 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 63 user_prefs->RegisterBooleanPref(prefs::kShowLogoutButtonInTray, | 63 registry->RegisterBooleanPref(prefs::kShowLogoutButtonInTray, |
| 64 false, | 64 false, |
| 65 PrefServiceSyncable::UNSYNCABLE_PREF); | 65 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 66 user_prefs->RegisterDictionaryPref(prefs::kShelfPreferences, | 66 registry->RegisterDictionaryPref(prefs::kShelfPreferences, |
| 67 PrefServiceSyncable::UNSYNCABLE_PREF); | 67 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 68 } | 68 } |
| 69 | 69 |
| 70 base::DictionaryValue* CreateAppDict(const std::string& app_id) { | 70 base::DictionaryValue* CreateAppDict(const std::string& app_id) { |
| 71 scoped_ptr<base::DictionaryValue> app_value(new base::DictionaryValue); | 71 scoped_ptr<base::DictionaryValue> app_value(new base::DictionaryValue); |
| 72 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id); | 72 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id); |
| 73 return app_value.release(); | 73 return app_value.release(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace ash | 76 } // namespace ash |
| OLD | NEW |