| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BANNERS_APP_BANNER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 virtual std::string GetAppIdentifier(); | 113 virtual std::string GetAppIdentifier(); |
| 114 | 114 |
| 115 // Return a string describing what type of banner is being created. Used when | 115 // Return a string describing what type of banner is being created. Used when |
| 116 // alerting websites that a banner is about to be created. | 116 // alerting websites that a banner is about to be created. |
| 117 virtual std::string GetBannerType(); | 117 virtual std::string GetBannerType(); |
| 118 | 118 |
| 119 // Returns a string parameter for a devtools console message corresponding to | 119 // Returns a string parameter for a devtools console message corresponding to |
| 120 // |code|. Returns the empty string if |code| requires no parameter. | 120 // |code|. Returns the empty string if |code| requires no parameter. |
| 121 std::string GetStatusParam(InstallableStatusCode code); | 121 std::string GetStatusParam(InstallableStatusCode code); |
| 122 | 122 |
| 123 // Returns the ideal and minimum icon sizes required for being installable. | 123 // Returns the ideal and minimum size requirements for icons. |
| 124 virtual int GetIdealIconSizeInPx(); | 124 virtual int GetIdealPrimaryIconSizeInPx(); |
| 125 virtual int GetMinimumIconSizeInPx(); | 125 virtual int GetMinimumPrimaryIconSizeInPx(); |
| 126 virtual int GetIdealBadgeIconSizeInPx(); |
| 126 | 127 |
| 127 // Returns a WeakPtr to this object. Exposed so subclasses/infobars may | 128 // Returns a WeakPtr to this object. Exposed so subclasses/infobars may |
| 128 // may bind callbacks without needing their own WeakPtrFactory. | 129 // may bind callbacks without needing their own WeakPtrFactory. |
| 129 base::WeakPtr<AppBannerManager> GetWeakPtr(); | 130 base::WeakPtr<AppBannerManager> GetWeakPtr(); |
| 130 | 131 |
| 131 // Returns true if |is_debug_mode_| is true or the | 132 // Returns true if |is_debug_mode_| is true or the |
| 132 // kBypassAppBannerEngagementChecks flag is set. | 133 // kBypassAppBannerEngagementChecks flag is set. |
| 133 virtual bool IsDebugMode() const; | 134 virtual bool IsDebugMode() const; |
| 134 | 135 |
| 135 // Returns true if the webapp at |start_url| has already been installed. | 136 // Returns true if the webapp at |start_url| has already been installed. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 202 |
| 202 // The URL for which the banner check is being conducted. | 203 // The URL for which the banner check is being conducted. |
| 203 GURL validated_url_; | 204 GURL validated_url_; |
| 204 | 205 |
| 205 // The URL of the manifest. | 206 // The URL of the manifest. |
| 206 GURL manifest_url_; | 207 GURL manifest_url_; |
| 207 | 208 |
| 208 // The manifest object. | 209 // The manifest object. |
| 209 content::Manifest manifest_; | 210 content::Manifest manifest_; |
| 210 | 211 |
| 211 // The URL of the icon. | 212 // Icon URLs. |
| 212 GURL icon_url_; | 213 GURL primary_icon_url_; |
| 214 GURL badge_icon_url_; |
| 213 | 215 |
| 214 // The icon object. | 216 // Icon objects. |
| 215 std::unique_ptr<SkBitmap> icon_; | 217 std::unique_ptr<SkBitmap> primary_icon_; |
| 218 std::unique_ptr<SkBitmap> badge_icon_; |
| 216 | 219 |
| 217 // The referrer string (if any) specified in the app URL. Used only for native | 220 // The referrer string (if any) specified in the app URL. Used only for native |
| 218 // app banners. | 221 // app banners. |
| 219 std::string referrer_; | 222 std::string referrer_; |
| 220 | 223 |
| 221 private: | 224 private: |
| 222 friend class AppBannerManagerTest; | 225 friend class AppBannerManagerTest; |
| 223 | 226 |
| 224 // Record that the banner could be shown at this point, if the triggering | 227 // Record that the banner could be shown at this point, if the triggering |
| 225 // heuristic allowed. | 228 // heuristic allowed. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // scoped to the WebContents which they are observing. This allows us to use | 283 // scoped to the WebContents which they are observing. This allows us to use |
| 281 // weak pointers for callbacks. | 284 // weak pointers for callbacks. |
| 282 base::WeakPtrFactory<AppBannerManager> weak_factory_; | 285 base::WeakPtrFactory<AppBannerManager> weak_factory_; |
| 283 | 286 |
| 284 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); | 287 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); |
| 285 }; | 288 }; |
| 286 | 289 |
| 287 } // namespace banners | 290 } // namespace banners |
| 288 | 291 |
| 289 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 292 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| OLD | NEW |