Chromium Code Reviews| Index: chrome/browser/web_resource/promo_resource_service.cc |
| diff --git a/chrome/browser/web_resource/promo_resource_service.cc b/chrome/browser/web_resource/promo_resource_service.cc |
| index 09b0aee48784886e7b45ad9a3182c98a054dc5d2..a15540d695a6d8a84449bee329a2835fba713e52 100644 |
| --- a/chrome/browser/web_resource/promo_resource_service.cc |
| +++ b/chrome/browser/web_resource/promo_resource_service.cc |
| @@ -316,13 +316,9 @@ void PromoResourceService::UnpackWebStoreSignal( |
| bool is_webstore_active = false; |
| bool signal_found = false; |
| - std::string promo_id = ""; |
| - std::string promo_header = ""; |
| - std::string promo_button = ""; |
| + AppsPromo::PromoData promo_data; |
| std::string promo_link = ""; |
| - std::string promo_expire = ""; |
| std::string promo_logo = ""; |
| - int maximize_setting = 0; |
| int target_builds = 0; |
| if (!parsed_json.GetDictionary("topic", &topic_dict) || |
| @@ -362,24 +358,26 @@ void PromoResourceService::UnpackWebStoreSignal( |
| name = name.substr(split+1); |
| split = name.find(':'); |
| if (split == std::string::npos || |
| - !base::StringToInt(name.substr(0, split), &maximize_setting)) |
| + !base::StringToInt(name.substr(0, split), &promo_data.user_group)) |
| continue; |
| // (4) optional text that specifies a URL of a logo image |
| promo_logo = name.substr(split+1); |
| - if (!a_dic->GetString(kAnswerIdProperty, &promo_id) || |
| - !a_dic->GetString(kWebStoreHeaderProperty, &promo_header) || |
| - !a_dic->GetString(kWebStoreButtonProperty, &promo_button) || |
| + if (!a_dic->GetString(kAnswerIdProperty, &promo_data.id) || |
| + !a_dic->GetString(kWebStoreHeaderProperty, &promo_data.header) || |
| + !a_dic->GetString(kWebStoreButtonProperty, &promo_data.button) || |
| !a_dic->GetString(kWebStoreLinkProperty, &promo_link) || |
| - !a_dic->GetString(kWebStoreExpireProperty, &promo_expire)) |
| + !a_dic->GetString(kWebStoreExpireProperty, &promo_data.expire)) |
| continue; |
| if (IsThisBuildTargeted(target_builds)) { |
| - // Store the first web store promo that targets the current build. |
| - AppsPromo::SetPromo(promo_id, promo_header, promo_button, |
| - GURL(promo_link), promo_expire, GURL(promo_logo), |
| - maximize_setting); |
| + // The downloader will set the promo prefs when complete, even if it |
|
Mihai Parparita -not on Chrome
2011/08/31 23:26:23
To be clearer, this should say "set the promo pref
jstritar
2011/09/01 16:10:13
Done.
|
| + // does not need to download the logo. |
| + promo_data.link = GURL(promo_link); |
| + promo_data.logo = GURL(promo_logo); |
| + apps_promo_logo_downloader_.reset( |
| + new AppsPromoLogoDownloader(profile_, promo_data)); |
| signal_found = true; |
| break; |
| } |
| @@ -392,11 +390,6 @@ void PromoResourceService::UnpackWebStoreSignal( |
| AppsPromo::SetWebStoreSupportedForLocale(is_webstore_active); |
| - NotificationService::current()->Notify( |
| - chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED, |
| - Source<Profile>(profile_), |
| - NotificationService::NoDetails()); |
| - |
| return; |
| } |