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.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 void PromoResourceService::Unpack(const DictionaryValue& parsed_json) { | 180 void PromoResourceService::Unpack(const DictionaryValue& parsed_json) { |
181 NotificationPromo notification_promo(profile_); | 181 NotificationPromo notification_promo(profile_); |
182 notification_promo.InitFromJson(parsed_json); | 182 notification_promo.InitFromJson(parsed_json); |
183 | 183 |
184 if (notification_promo.new_notification()) { | 184 if (notification_promo.new_notification()) { |
185 ScheduleNotification(notification_promo.StartTimeForGroup(), | 185 ScheduleNotification(notification_promo.StartTimeForGroup(), |
186 notification_promo.EndTime()); | 186 notification_promo.EndTime()); |
187 } | 187 } |
188 } | 188 } |
189 | |
190 bool PromoResourceService::CanShowNotificationPromo(Profile* profile) { | |
191 NotificationPromo notification_promo(profile); | |
192 notification_promo.InitFromPrefs(); | |
193 return notification_promo.CanShow(); | |
194 } | |
OLD | NEW |