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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return local_state->GetInteger(prefs::kNtpPromoVersion); | 172 return local_state->GetInteger(prefs::kNtpPromoVersion); |
173 } | 173 } |
174 | 174 |
175 std::string PromoResourceService::GetPromoLocale() { | 175 std::string PromoResourceService::GetPromoLocale() { |
176 PrefService* local_state = g_browser_process->local_state(); | 176 PrefService* local_state = g_browser_process->local_state(); |
177 return local_state->GetString(prefs::kNtpPromoLocale); | 177 return local_state->GetString(prefs::kNtpPromoLocale); |
178 } | 178 } |
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 NotificationPromo::PromoType promo_type = |
| 183 #if !defined(OS_ANDROID) |
| 184 NotificationPromo::NTP_NOTIFICATION_PROMO; |
| 185 #else |
| 186 NotificationPromo::MOBILE_NTP_SYNC_PROMO; |
| 187 #endif |
| 188 notification_promo.InitFromJson(parsed_json, promo_type); |
183 | 189 |
184 if (notification_promo.new_notification()) { | 190 if (notification_promo.new_notification()) { |
185 ScheduleNotification(notification_promo.StartTimeForGroup(), | 191 ScheduleNotification(notification_promo.StartTimeForGroup(), |
186 notification_promo.EndTime()); | 192 notification_promo.EndTime()); |
187 } | 193 } |
188 } | 194 } |
OLD | NEW |