Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: chrome/browser/web_resource/promo_resource_service.cc

Issue 10836099: Support for promo_type. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review feedback Created 8 years, 4 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.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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/web_resource/notification_promo.cc ('k') | chrome/browser/web_resource/promo_resource_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698