Index: chrome/browser/android/banners/app_banner_manager.h |
diff --git a/chrome/browser/android/banners/app_banner_manager.h b/chrome/browser/android/banners/app_banner_manager.h |
index 9a8520c269cc211d55bc5a8b3c2a3de6dd8d09e0..f527c938d04970561632fc0bac3c2cbf85cd84a6 100644 |
--- a/chrome/browser/android/banners/app_banner_manager.h |
+++ b/chrome/browser/android/banners/app_banner_manager.h |
@@ -67,8 +67,9 @@ class InfoBar; |
namespace banners { |
-class AppBannerManager : public chrome::BitmapFetcherDelegate, |
- public content::WebContentsObserver { |
+class AppBannerManager : public content::WebContentsObserver { |
+ class BannerBitmapFetcher; |
benwells
2015/02/18 06:01:18
This should be after 'public:', if it has to be pu
gone
2015/02/18 18:33:29
Couldn't put it under private because it's referen
|
+ |
public: |
AppBannerManager(JNIEnv* env, jobject obj); |
~AppBannerManager() override; |
@@ -94,8 +95,13 @@ class AppBannerManager : public chrome::BitmapFetcherDelegate, |
// Returns |false| if this couldn't be kicked off. |
bool FetchIcon(const GURL& image_url); |
- // Return how many fetchers are active. |
- int GetNumActiveFetchers(JNIEnv* env, jobject jobj); |
+ // Called when everything required to show a banner is ready. |
+ void OnFetchComplete(BannerBitmapFetcher* fetcher, |
+ const GURL url, |
+ const SkBitmap* icon); |
+ |
+ // Return whether a BitmapFetcher is active. |
+ bool IsFetcherActive(JNIEnv* env, jobject jobj); |
// Returns the current time. |
static base::Time GetCurrentTime(); |
@@ -108,9 +114,6 @@ class AppBannerManager : public chrome::BitmapFetcherDelegate, |
const GURL& validated_url) override; |
bool OnMessageReceived(const IPC::Message& message) override; |
- // BitmapFetcherDelegate overrides. |
- void OnFetchComplete(const GURL url, const SkBitmap* bitmap) override; |
- |
private: |
// Gets the preferred icon size for the banner icons. |
int GetPreferredIconSize(); |
@@ -138,8 +141,12 @@ class AppBannerManager : public chrome::BitmapFetcherDelegate, |
// Check if the banner should be shown. |
bool CheckIfShouldShow(const std::string& package_or_start_url); |
- // Fetches the icon for an app. |
- scoped_ptr<chrome::BitmapFetcher> fetcher_; |
+ // Cancels an active BitmapFetcher, stopping its banner from appearing. |
+ void CancelActiveFetcher(); |
+ |
+ // Fetches the icon for an app. Weakly held because they delete themselves. |
+ BannerBitmapFetcher* fetcher_; |
+ |
GURL validated_url_; |
GURL app_icon_url_; |