| 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 "components/web_resource/promo_resource_service.h" | 5 #include "components/web_resource/promo_resource_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/prefs/pref_registry_simple.h" | |
| 14 #include "base/prefs/pref_service.h" | |
| 15 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 16 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
| 17 #include "base/threading/thread_restrictions.h" | 15 #include "base/threading/thread_restrictions.h" |
| 18 #include "base/values.h" | 16 #include "base/values.h" |
| 19 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 20 #include "components/pref_registry/pref_registry_syncable.h" | 18 #include "components/pref_registry/pref_registry_syncable.h" |
| 19 #include "components/prefs/pref_registry_simple.h" |
| 20 #include "components/prefs/pref_service.h" |
| 21 #include "components/web_resource/notification_promo.h" | 21 #include "components/web_resource/notification_promo.h" |
| 22 #include "components/web_resource/web_resource_pref_names.h" | 22 #include "components/web_resource/web_resource_pref_names.h" |
| 23 #include "components/web_resource/web_resource_switches.h" | 23 #include "components/web_resource/web_resource_switches.h" |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| 26 namespace web_resource { | 26 namespace web_resource { |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 // Delay on first fetch so we don't interfere with startup. | 30 // Delay on first fetch so we don't interfere with startup. |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 void PromoResourceService::Unpack(const base::DictionaryValue& parsed_json) { | 182 void PromoResourceService::Unpack(const base::DictionaryValue& parsed_json) { |
| 183 for (size_t i = 0; i < arraysize(kValidPromoTypes); ++i) { | 183 for (size_t i = 0; i < arraysize(kValidPromoTypes); ++i) { |
| 184 NotificationPromo notification_promo(prefs_); | 184 NotificationPromo notification_promo(prefs_); |
| 185 notification_promo.InitFromJson(parsed_json, kValidPromoTypes[i]); | 185 notification_promo.InitFromJson(parsed_json, kValidPromoTypes[i]); |
| 186 if (notification_promo.new_notification()) | 186 if (notification_promo.new_notification()) |
| 187 ScheduleNotification(notification_promo); | 187 ScheduleNotification(notification_promo); |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace web_resource | 191 } // namespace web_resource |
| OLD | NEW |