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

Unified Diff: chrome/browser/web_resource/promo_resource_service.h

Issue 7820003: Add support to download web store promo logos over https. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix sync failures Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/web_resource/promo_resource_service.h
diff --git a/chrome/browser/web_resource/promo_resource_service.h b/chrome/browser/web_resource/promo_resource_service.h
index 23504187e7b43da8373bb7e1ab643afe901f1d30..a68e2aaed5914417057fcdedc0b93012ea9ff1d8 100644
--- a/chrome/browser/web_resource/promo_resource_service.h
+++ b/chrome/browser/web_resource/promo_resource_service.h
@@ -11,6 +11,8 @@
#include "chrome/browser/web_resource/web_resource_service.h"
#include "chrome/common/chrome_version_info.h"
+class AppsPromoLogoFetcher;
+class PrefService;
class Profile;
namespace PromoResourceServiceUtil {
@@ -21,8 +23,6 @@ bool CanShowPromo(Profile* profile);
} // namespace PromoResourceServiceUtil
-class PrefService;
-
// A PromoResourceService fetches data from a web resource server to be used to
// dynamically change the appearance of the New Tab Page. For example, it has
// been used to fetch "tips" to be displayed on the NTP, or to display
@@ -52,6 +52,13 @@ class PromoResourceService
FRIEND_TEST_ALL_PREFIXES(PromoResourceServiceTest, UnpackWebStoreSignal);
FRIEND_TEST_ALL_PREFIXES(
PromoResourceServiceTest, UnpackPartialWebStoreSignal);
+ FRIEND_TEST_ALL_PREFIXES(
+ PromoResourceServiceTest, UnpackWebStoreSignalHttpsLogo);
+ FRIEND_TEST_ALL_PREFIXES(
+ PromoResourceServiceTest, UnpackWebStoreSignalHttpsLogoError);
+ FRIEND_TEST_ALL_PREFIXES(
+ PromoResourceServiceTest, UnpackWebStoreSignalHttpLogo);
+
// Identifies types of Chrome builds for promo targeting.
enum BuildType {
@@ -168,7 +175,7 @@ class PromoResourceService
// "answers": [
// {
// "answer_id": "1143011",
- // "name": "webstore_promo:15:",
+ // "name": "webstore_promo:15:1:https://www.google.com/logo.png",
// "question": "Browse thousands of apps and games for Chrome.",
// "inproduct_target": "Visit the Chrome Web Store",
// "inproduct": "https://chrome.google.com/webstore?hl=en",
@@ -184,11 +191,13 @@ class PromoResourceService
// inproduct_target: the promo button text
// inproduct: the promo button link
// tooltip: the text for the "hide this" link on the promo
- // name: starts with "webstore_promo" to identify the signal. the second
+ // name: starts with "webstore_promo" to identify the signal. The second
// part contains the release channels targeted (bitwise or of
- // BuildTypes). The third part is optional and specifies the URL of
- // the logo image. In the example above, the URL is empty so the
- // default webstore logo will be used.
+ // BuildTypes). The third part specifies what users should maximize
+ // the apps section of the NTP when first loading the promo (bitwise
+ // or of AppsPromo::UserGroup). The forth part is optional and
+ // specifies the URL of the logo image. If left out, the default
+ // webstore logo will be used. The logo can be an HTTPS or DATA URL.
// answer_id: the promo's id
void UnpackWebStoreSignal(const base::DictionaryValue& parsed_json);
@@ -202,6 +211,9 @@ class PromoResourceService
// Overrides the current Chrome release channel for testing purposes.
chrome::VersionInfo::Channel channel_;
+ // A helper that downloads the promo logo.
+ scoped_ptr<AppsPromoLogoFetcher> apps_promo_logo_fetcher_;
+
DISALLOW_COPY_AND_ASSIGN(PromoResourceService);
};
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.cc ('k') | chrome/browser/web_resource/promo_resource_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698