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/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/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/user_prefs/pref_registry_syncable.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 168 } |
169 | 169 |
170 void PromoResourceService::Unpack(const DictionaryValue& parsed_json) { | 170 void PromoResourceService::Unpack(const DictionaryValue& parsed_json) { |
171 for (size_t i = 0; i < arraysize(kValidPromoTypes); ++i) { | 171 for (size_t i = 0; i < arraysize(kValidPromoTypes); ++i) { |
172 NotificationPromo notification_promo; | 172 NotificationPromo notification_promo; |
173 notification_promo.InitFromJson(parsed_json, kValidPromoTypes[i]); | 173 notification_promo.InitFromJson(parsed_json, kValidPromoTypes[i]); |
174 if (notification_promo.new_notification()) | 174 if (notification_promo.new_notification()) |
175 ScheduleNotification(notification_promo); | 175 ScheduleNotification(notification_promo); |
176 } | 176 } |
177 } | 177 } |
OLD | NEW |