Index: chrome/browser/banners/app_banner_data_fetcher.h |
diff --git a/chrome/browser/banners/app_banner_data_fetcher.h b/chrome/browser/banners/app_banner_data_fetcher.h |
index 3ed3d6eb9e564426b1ceae754f8c858ecdf1fa16..cd8b9d1e0e7e2bb2e3b6f9432e5b25d256342c9d 100644 |
--- a/chrome/browser/banners/app_banner_data_fetcher.h |
+++ b/chrome/browser/banners/app_banner_data_fetcher.h |
@@ -10,7 +10,6 @@ |
#include "base/memory/weak_ptr.h" |
#include "base/observer_list.h" |
#include "base/time/time.h" |
-#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_delegate.h" |
#include "chrome/common/web_application_info.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_observer.h" |
@@ -32,7 +31,6 @@ class AppBannerDataFetcher; |
// the WebContents. |
class AppBannerDataFetcher |
: public base::RefCounted<AppBannerDataFetcher>, |
- public chrome::BitmapFetcherDelegate, |
public content::WebContentsObserver { |
public: |
class Observer { |
@@ -120,6 +118,10 @@ class AppBannerDataFetcher |
void OnRequestShowAppBanner(content::RenderFrameHost* render_frame_host, |
int request_id); |
+ // Called when it is determined that the webapp has fulfilled the initial |
+ // criteria of having a manifest and a service worker. |
+ void OnHasServiceWorker(content::WebContents* web_contents); |
+ |
content::WebContents* GetWebContents(); |
virtual std::string GetAppIdentifier(); |
const content::Manifest& web_app_data() { return web_app_data_; } |
@@ -128,7 +130,7 @@ class AppBannerDataFetcher |
// Fetches the icon at the given URL asynchronously, returning |false| if a |
// load could not be started. |
- bool FetchIcon(const GURL& image_url); |
+ bool FetchAppIcon(content::WebContents* web_contents, const GURL& url); |
// Records that a banner was shown. The |event_name| corresponds to the RAPPOR |
// metric being recorded. |
@@ -138,16 +140,13 @@ class AppBannerDataFetcher |
// Callbacks for data retrieval. |
void OnDidGetManifest(const content::Manifest& manifest); |
void OnDidCheckHasServiceWorker(bool has_service_worker); |
- void OnFetchComplete(const GURL& url, const SkBitmap* icon) override; |
+ void OnAppIconFetched(const SkBitmap& bitmap); |
// Returns whether the given web app has already been installed. |
// Implemented on desktop platforms only. |
virtual bool IsWebAppInstalled(content::BrowserContext* browser_context, |
const GURL& start_url); |
- // Shows a banner for the app, if the given |icon| is valid. |
- virtual void RequestShowBanner(const SkBitmap* icon); |
- |
// Record that the banner could be shown at this point, if the triggering |
// heuristic allowed. |
void RecordCouldShowBanner(); |
@@ -176,7 +175,6 @@ class AppBannerDataFetcher |
bool page_requested_prompt_; |
ui::PageTransition transition_type_; |
int event_request_id_; |
- scoped_ptr<chrome::BitmapFetcher> bitmap_fetcher_; |
scoped_ptr<SkBitmap> app_icon_; |
GURL validated_url_; |