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

Side by Side Diff: chrome/browser/web_resource/promo_resource_service.cc

Issue 14622003: components: Move PrefRegistrySyncable into user_prefs namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 7 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 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/web_resource/promo_resource_service.h" 5 #include "chrome/browser/web_resource/promo_resource_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 } // namespace 62 } // namespace
63 63
64 // static 64 // static
65 void PromoResourceService::RegisterPrefs(PrefRegistrySimple* registry) { 65 void PromoResourceService::RegisterPrefs(PrefRegistrySimple* registry) {
66 registry->RegisterStringPref(prefs::kNtpPromoResourceCacheUpdate, "0"); 66 registry->RegisterStringPref(prefs::kNtpPromoResourceCacheUpdate, "0");
67 NotificationPromo::RegisterPrefs(registry); 67 NotificationPromo::RegisterPrefs(registry);
68 } 68 }
69 69
70 // static 70 // static
71 void PromoResourceService::RegisterUserPrefs(PrefRegistrySyncable* registry) { 71 void PromoResourceService::RegisterUserPrefs(
72 user_prefs::PrefRegistrySyncable* registry) {
72 // TODO(dbeam): This is registered only for migration; remove in M28 73 // TODO(dbeam): This is registered only for migration; remove in M28
73 // when all prefs have been cleared. http://crbug.com/168887 74 // when all prefs have been cleared. http://crbug.com/168887
74 registry->RegisterStringPref(prefs::kNtpPromoResourceCacheUpdate, 75 registry->RegisterStringPref(
75 "0", 76 prefs::kNtpPromoResourceCacheUpdate,
76 PrefRegistrySyncable::UNSYNCABLE_PREF); 77 "0",
78 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
77 NotificationPromo::RegisterUserPrefs(registry); 79 NotificationPromo::RegisterUserPrefs(registry);
78 } 80 }
79 81
80 // static 82 // static
81 void PromoResourceService::MigrateUserPrefs(PrefService* user_prefs) { 83 void PromoResourceService::MigrateUserPrefs(PrefService* user_prefs) {
82 user_prefs->ClearPref(prefs::kNtpPromoResourceCacheUpdate); 84 user_prefs->ClearPref(prefs::kNtpPromoResourceCacheUpdate);
83 NotificationPromo::MigrateUserPrefs(user_prefs); 85 NotificationPromo::MigrateUserPrefs(user_prefs);
84 } 86 }
85 87
86 PromoResourceService::PromoResourceService() 88 PromoResourceService::PromoResourceService()
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 168 }
167 169
168 void PromoResourceService::Unpack(const DictionaryValue& parsed_json) { 170 void PromoResourceService::Unpack(const DictionaryValue& parsed_json) {
169 for (size_t i = 0; i < arraysize(kValidPromoTypes); ++i) { 171 for (size_t i = 0; i < arraysize(kValidPromoTypes); ++i) {
170 NotificationPromo notification_promo; 172 NotificationPromo notification_promo;
171 notification_promo.InitFromJson(parsed_json, kValidPromoTypes[i]); 173 notification_promo.InitFromJson(parsed_json, kValidPromoTypes[i]);
172 if (notification_promo.new_notification()) 174 if (notification_promo.new_notification())
173 ScheduleNotification(notification_promo); 175 ScheduleNotification(notification_promo);
174 } 176 }
175 } 177 }
OLDNEW
« no previous file with comments | « chrome/browser/web_resource/promo_resource_service.h ('k') | chrome/test/base/testing_pref_service_syncable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698