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/web_resource/promo_resource_service.cc

Issue 271793003: components: Extract pref_registry component out of user_prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/threading/thread_restrictions.h" 12 #include "base/threading/thread_restrictions.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/web_resource/notification_promo.h" 16 #include "chrome/browser/web_resource/notification_promo.h"
17 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
18 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
19 #include "components/user_prefs/pref_registry_syncable.h" 19 #include "components/pref_registry/pref_registry_syncable.h"
20 #include "content/public/browser/notification_service.h" 20 #include "content/public/browser/notification_service.h"
21 #include "url/gurl.h" 21 #include "url/gurl.h"
22 22
23 namespace { 23 namespace {
24 24
25 // Delay on first fetch so we don't interfere with startup. 25 // Delay on first fetch so we don't interfere with startup.
26 const int kStartResourceFetchDelay = 5000; 26 const int kStartResourceFetchDelay = 5000;
27 27
28 // Delay between calls to fetch the promo json: 6 hours in production, and 3 min 28 // Delay between calls to fetch the promo json: 6 hours in production, and 3 min
29 // in debug. 29 // in debug.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 165
166 void PromoResourceService::Unpack(const base::DictionaryValue& parsed_json) { 166 void PromoResourceService::Unpack(const base::DictionaryValue& parsed_json) {
167 for (size_t i = 0; i < arraysize(kValidPromoTypes); ++i) { 167 for (size_t i = 0; i < arraysize(kValidPromoTypes); ++i) {
168 NotificationPromo notification_promo; 168 NotificationPromo notification_promo;
169 notification_promo.InitFromJson(parsed_json, kValidPromoTypes[i]); 169 notification_promo.InitFromJson(parsed_json, kValidPromoTypes[i]);
170 if (notification_promo.new_notification()) 170 if (notification_promo.new_notification())
171 ScheduleNotification(notification_promo); 171 ScheduleNotification(notification_promo);
172 } 172 }
173 } 173 }
OLDNEW
« no previous file with comments | « chrome/browser/web_resource/notification_promo.cc ('k') | chrome/test/base/testing_pref_service_syncable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698