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

Side by Side Diff: chrome/browser/extensions/apps_promo.h

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 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
« no previous file with comments | « chrome/browser/extensions/app_sync_data.h ('k') | chrome/browser/extensions/apps_promo.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_EXTENSIONS_APPS_PROMO_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_APPS_PROMO_H_
6 #define CHROME_BROWSER_EXTENSIONS_APPS_PROMO_H_ 6 #define CHROME_BROWSER_EXTENSIONS_APPS_PROMO_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Gets the original URL of the logo. This should only be set when the logo 81 // Gets the original URL of the logo. This should only be set when the logo
82 // was served over HTTPS. 82 // was served over HTTPS.
83 static GURL GetSourcePromoLogoURL(); 83 static GURL GetSourcePromoLogoURL();
84 static void SetSourcePromoLogoURL(const GURL& original_url); 84 static void SetSourcePromoLogoURL(const GURL& original_url);
85 85
86 explicit AppsPromo(PrefService* prefs); 86 explicit AppsPromo(PrefService* prefs);
87 ~AppsPromo(); 87 ~AppsPromo();
88 88
89 // Gets the set of old default apps that may have been installed by previous 89 // Gets the set of old default apps that may have been installed by previous
90 // versions of Chrome. 90 // versions of Chrome.
91 const ExtensionIdSet& old_default_apps() const { 91 const extensions::ExtensionIdSet& old_default_apps() const {
92 return old_default_app_ids_; 92 return old_default_app_ids_;
93 } 93 }
94 94
95 // Halts the special treatment of the default apps. The default apps may be 95 // Halts the special treatment of the default apps. The default apps may be
96 // removed by the caller after calling this method. If the apps remain 96 // removed by the caller after calling this method. If the apps remain
97 // installed, AppsPromo will no longer consider the apps "default". 97 // installed, AppsPromo will no longer consider the apps "default".
98 void ExpireDefaultApps(); 98 void ExpireDefaultApps();
99 99
100 // Called to hide the promo from the apps section. 100 // Called to hide the promo from the apps section.
101 void HidePromo(); 101 void HidePromo();
102 102
103 // Returns true if the app launcher should be displayed on the NTP. 103 // Returns true if the app launcher should be displayed on the NTP.
104 bool ShouldShowAppLauncher(const ExtensionIdSet& installed_ids); 104 bool ShouldShowAppLauncher(const extensions::ExtensionIdSet& installed_ids);
105 105
106 // Returns true if the apps promo should be displayed in the launcher. 106 // Returns true if the apps promo should be displayed in the launcher.
107 bool ShouldShowPromo(const ExtensionIdSet& installed_ids, 107 bool ShouldShowPromo(const extensions::ExtensionIdSet& installed_ids,
108 bool* just_expired); 108 bool* just_expired);
109 109
110 private: 110 private:
111 FRIEND_TEST_ALL_PREFIXES(ExtensionAppsPromo, HappyPath); 111 FRIEND_TEST_ALL_PREFIXES(ExtensionAppsPromo, HappyPath);
112 FRIEND_TEST_ALL_PREFIXES(ExtensionAppsPromo, PromoPrefs); 112 FRIEND_TEST_ALL_PREFIXES(ExtensionAppsPromo, PromoPrefs);
113 FRIEND_TEST_ALL_PREFIXES(ExtensionAppsPromo, UpdatePromoFocus); 113 FRIEND_TEST_ALL_PREFIXES(ExtensionAppsPromo, UpdatePromoFocus);
114 114
115 // The maximum number of times to show the apps promo. The promo counter 115 // The maximum number of times to show the apps promo. The promo counter
116 // actually goes up to this number + 1 because we need to differentiate 116 // actually goes up to this number + 1 because we need to differentiate
117 // between the first time we overflow and subsequent times. 117 // between the first time we overflow and subsequent times.
(...skipping 11 matching lines...) Expand all
129 // Gets/sets the number of times the promo has been viewed. Promo views are 129 // Gets/sets the number of times the promo has been viewed. Promo views are
130 // only counted when the default apps are installed. 130 // only counted when the default apps are installed.
131 int GetPromoCounter() const; 131 int GetPromoCounter() const;
132 void SetPromoCounter(int val); 132 void SetPromoCounter(int val);
133 133
134 // Our permanent state is stored in this PrefService instance. 134 // Our permanent state is stored in this PrefService instance.
135 PrefService* prefs_; 135 PrefService* prefs_;
136 136
137 // The set of default extensions. Initialized to a static list in the 137 // The set of default extensions. Initialized to a static list in the
138 // constructor. 138 // constructor.
139 ExtensionIdSet old_default_app_ids_; 139 extensions::ExtensionIdSet old_default_app_ids_;
140 140
141 DISALLOW_COPY_AND_ASSIGN(AppsPromo); 141 DISALLOW_COPY_AND_ASSIGN(AppsPromo);
142 }; 142 };
143 143
144 // Fetches logos over HTTPS, making sure we don't send cookies and that we 144 // Fetches logos over HTTPS, making sure we don't send cookies and that we
145 // cache the image until its source URL changes. 145 // cache the image until its source URL changes.
146 class AppsPromoLogoFetcher : public content::URLFetcherDelegate { 146 class AppsPromoLogoFetcher : public content::URLFetcherDelegate {
147 public: 147 public:
148 AppsPromoLogoFetcher(Profile* profile, 148 AppsPromoLogoFetcher(Profile* profile,
149 const AppsPromo::PromoData& promo_data); 149 const AppsPromo::PromoData& promo_data);
(...skipping 14 matching lines...) Expand all
164 164
165 // Checks if the promo logo matches https://*.google.com/*.png. 165 // Checks if the promo logo matches https://*.google.com/*.png.
166 bool SupportsLogoURL(); 166 bool SupportsLogoURL();
167 167
168 Profile* profile_; 168 Profile* profile_;
169 AppsPromo::PromoData promo_data_; 169 AppsPromo::PromoData promo_data_;
170 scoped_ptr<content::URLFetcher> url_fetcher_; 170 scoped_ptr<content::URLFetcher> url_fetcher_;
171 }; 171 };
172 172
173 #endif // CHROME_BROWSER_EXTENSIONS_APPS_PROMO_H_ 173 #endif // CHROME_BROWSER_EXTENSIONS_APPS_PROMO_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_sync_data.h ('k') | chrome/browser/extensions/apps_promo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698