| 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_DATA_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ |
| 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ | 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Fetches the icon at the given URL asynchronously, returning |false| if a | 140 // Fetches the icon at the given URL asynchronously, returning |false| if a |
| 141 // load could not be started. | 141 // load could not be started. |
| 142 bool FetchAppIcon(content::WebContents* web_contents, const GURL& url); | 142 bool FetchAppIcon(content::WebContents* web_contents, const GURL& url); |
| 143 | 143 |
| 144 // Records that a banner was shown. The |event_name| corresponds to the RAPPOR | 144 // Records that a banner was shown. The |event_name| corresponds to the RAPPOR |
| 145 // metric being recorded. | 145 // metric being recorded. |
| 146 void RecordDidShowBanner(const std::string& event_name); | 146 void RecordDidShowBanner(const std::string& event_name); |
| 147 | 147 |
| 148 private: | 148 private: |
| 149 // Callbacks for data retrieval. | 149 // Callbacks for data retrieval. |
| 150 void OnDidHasManifest(bool has_manifest); | |
| 151 void OnDidGetManifest(const GURL& manifest_url, | 150 void OnDidGetManifest(const GURL& manifest_url, |
| 152 const content::Manifest& manifest); | 151 const content::Manifest& manifest); |
| 153 void OnDidCheckHasServiceWorker(bool has_service_worker); | 152 void OnDidCheckHasServiceWorker(bool has_service_worker); |
| 154 void OnAppIconFetched(const SkBitmap& bitmap); | 153 void OnAppIconFetched(const SkBitmap& bitmap); |
| 155 | 154 |
| 156 // Called when it is determined that the webapp has fulfilled the initial | 155 // Called when it is determined that the webapp has fulfilled the initial |
| 157 // criteria of having a manifest and a service worker. | 156 // criteria of having a manifest and a service worker. |
| 158 void OnHasServiceWorker(content::WebContents* web_contents); | 157 void OnHasServiceWorker(content::WebContents* web_contents); |
| 159 | 158 |
| 160 // Returns whether the given web app has already been installed. | 159 // Returns whether the given web app has already been installed. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 content::BrowserThread::UI>; | 210 content::BrowserThread::UI>; |
| 212 friend class base::DeleteHelper<AppBannerDataFetcher>; | 211 friend class base::DeleteHelper<AppBannerDataFetcher>; |
| 213 friend class AppBannerDataFetcherUnitTest; | 212 friend class AppBannerDataFetcherUnitTest; |
| 214 friend class base::RefCounted<AppBannerDataFetcher>; | 213 friend class base::RefCounted<AppBannerDataFetcher>; |
| 215 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcher); | 214 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcher); |
| 216 }; | 215 }; |
| 217 | 216 |
| 218 } // namespace banners | 217 } // namespace banners |
| 219 | 218 |
| 220 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ | 219 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ |
| OLD | NEW |