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

Unified Diff: chrome/browser/banners/app_banner_data_fetcher.h

Issue 1261143004: Implement manifest icon downloader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add scaling to non correct icons Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
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..711e067c97978c8705e4a0a87823c0521a515d30 100644
--- a/chrome/browser/banners/app_banner_data_fetcher.h
+++ b/chrome/browser/banners/app_banner_data_fetcher.h
@@ -10,7 +10,7 @@
#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/browser/manifest/manifest_icon_downloader.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 +32,6 @@ class AppBannerDataFetcher;
// the WebContents.
class AppBannerDataFetcher
: public base::RefCounted<AppBannerDataFetcher>,
- public chrome::BitmapFetcherDelegate,
public content::WebContentsObserver {
public:
class Observer {
@@ -120,15 +119,19 @@ class AppBannerDataFetcher
void OnRequestShowAppBanner(content::RenderFrameHost* render_frame_host,
int request_id);
+ // Called when we know we have a service worker and a manifest.
+ void OnHasServiceWorker(content::WebContents* web_contents);
gone 2015/07/31 18:09:20 This should be private. Remove the comment; it ma
Lalit Maganti 2015/08/03 08:58:29 protected for future use. Will remove comment.
Lalit Maganti 2015/08/04 17:26:45 Done.
+
content::WebContents* GetWebContents();
virtual std::string GetAppIdentifier();
const content::Manifest& web_app_data() { return web_app_data_; }
void set_app_title(const base::string16& title) { app_title_ = title; }
int event_request_id() { return event_request_id_; }
+ const scoped_ptr<ManifestIconDownloader>& icon_downloader() { return icon_downloader_; }
gone 2015/07/31 18:09:20 Why is this accessor necessary? Does anything cal
Lalit Maganti 2015/08/03 08:58:29 For future use.
// 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,7 +141,7 @@ 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.
@@ -146,7 +149,8 @@ class AppBannerDataFetcher
const GURL& start_url);
// Shows a banner for the app, if the given |icon| is valid.
- virtual void RequestShowBanner(const SkBitmap* icon);
+ virtual void RequestShowBanner(content::WebContents* web_contents,
+ const SkBitmap& icon);
// Record that the banner could be shown at this point, if the triggering
// heuristic allowed.
@@ -176,7 +180,7 @@ class AppBannerDataFetcher
bool page_requested_prompt_;
ui::PageTransition transition_type_;
int event_request_id_;
- scoped_ptr<chrome::BitmapFetcher> bitmap_fetcher_;
+ scoped_ptr<ManifestIconDownloader> icon_downloader_;
scoped_ptr<SkBitmap> app_icon_;
GURL validated_url_;

Powered by Google App Engine
This is Rietveld 408576698