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

Side by Side Diff: chrome/browser/ui/ash/chrome_launcher_prefs.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 23 matching lines...) Expand all
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 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 43
44 void RegisterChromeLauncherUserPrefs(PrefService* user_prefs) { 44 void RegisterChromeLauncherUserPrefs(PrefServiceSyncable* user_prefs) {
45 // 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
46 // 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.
47 user_prefs->RegisterListPref(prefs::kPinnedLauncherApps, 47 user_prefs->RegisterListPref(prefs::kPinnedLauncherApps,
48 CreateDefaultPinnedAppsList(), 48 CreateDefaultPinnedAppsList(),
49 PrefService::SYNCABLE_PREF); 49 PrefServiceSyncable::SYNCABLE_PREF);
50 user_prefs->RegisterStringPref(prefs::kShelfAutoHideBehavior, 50 user_prefs->RegisterStringPref(prefs::kShelfAutoHideBehavior,
51 kShelfAutoHideBehaviorNever, 51 kShelfAutoHideBehaviorNever,
52 PrefService::SYNCABLE_PREF); 52 PrefServiceSyncable::SYNCABLE_PREF);
53 user_prefs->RegisterStringPref(prefs::kShelfAutoHideBehaviorLocal, 53 user_prefs->RegisterStringPref(prefs::kShelfAutoHideBehaviorLocal,
54 std::string(), 54 std::string(),
55 PrefService::UNSYNCABLE_PREF); 55 PrefServiceSyncable::UNSYNCABLE_PREF);
56 user_prefs->RegisterStringPref(prefs::kShelfAlignment, 56 user_prefs->RegisterStringPref(prefs::kShelfAlignment,
57 kShelfAlignmentBottom, 57 kShelfAlignmentBottom,
58 PrefService::SYNCABLE_PREF); 58 PrefServiceSyncable::SYNCABLE_PREF);
59 user_prefs->RegisterStringPref(prefs::kShelfAlignmentLocal, 59 user_prefs->RegisterStringPref(prefs::kShelfAlignmentLocal,
60 std::string(), 60 std::string(),
61 PrefService::UNSYNCABLE_PREF); 61 PrefServiceSyncable::UNSYNCABLE_PREF);
62 user_prefs->RegisterBooleanPref(prefs::kShowLogoutButtonInTray, 62 user_prefs->RegisterBooleanPref(prefs::kShowLogoutButtonInTray,
63 false, 63 false,
64 PrefService::UNSYNCABLE_PREF); 64 PrefServiceSyncable::UNSYNCABLE_PREF);
65 user_prefs->RegisterDictionaryPref(prefs::kShelfPreferences, 65 user_prefs->RegisterDictionaryPref(prefs::kShelfPreferences,
66 PrefService::UNSYNCABLE_PREF); 66 PrefServiceSyncable::UNSYNCABLE_PREF);
67 } 67 }
68 68
69 base::DictionaryValue* CreateAppDict(const std::string& app_id) { 69 base::DictionaryValue* CreateAppDict(const std::string& app_id) {
70 scoped_ptr<base::DictionaryValue> app_value(new base::DictionaryValue); 70 scoped_ptr<base::DictionaryValue> app_value(new base::DictionaryValue);
71 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id); 71 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id);
72 return app_value.release(); 72 return app_value.release();
73 } 73 }
74 74
75 } // namespace ash 75 } // namespace ash
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_launcher_prefs.h ('k') | chrome/browser/ui/ash/event_rewriter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698