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

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h

Issue 2218413002: Calls ShortcutHelper::FinalizeLauncherIcon() on worker thread instead of on IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_builder_impl2_thread0 Created 4 years, 4 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/android/webapps/add_to_homescreen_data_fetcher.h
diff --git a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
index d02b94576e07aa3f981ee13c89db80f71d8d2554..55ca890e9bbbbbb2b71ae79befa13e2c7b9e7348 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
+++ b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
@@ -44,9 +44,9 @@ class AddToHomescreenDataFetcher
// Converts the icon into one that can be used on the Android Home screen.
// |is_generated| is an out-param that indicates whether the icon was
// generated by Chrome.
- virtual SkBitmap FinalizeLauncherIcon(const SkBitmap& icon,
- const GURL& url,
- bool* is_generated) = 0;
+ virtual SkBitmap FinalizeLauncherIconInBackground(const SkBitmap& icon,
+ const GURL& url,
+ bool* is_generated) = 0;
// Called when all the data needed to create a shortcut is available.
virtual void OnDataAvailable(const ShortcutInfo& info,
@@ -91,8 +91,11 @@ class AddToHomescreenDataFetcher
void OnFaviconFetched(
const favicon_base::FaviconRawBitmapResult& bitmap_result);
- // Creates the launcher icon from the given bitmap.
- void CreateLauncherIcon(
+ // Creates the launcher icon from the given bitmap and page URL. The page URL
+ // is used to generate an icon if there is no bitmap in |bitmap_result| or the
+ // bitmap is not large enough.
+ void CreateLauncherIconInBackground(
+ const GURL& page_url,
const favicon_base::FaviconRawBitmapResult& bitmap_result);
// Callback run after an attempt to download manifest icon has been made. May
@@ -100,7 +103,7 @@ class AddToHomescreenDataFetcher
void OnManifestIconFetched(const GURL& icon_url, const SkBitmap& icon);
// Notifies the observer that the shortcut data is all available.
- void NotifyObserver(const SkBitmap& icon);
+ void NotifyObserver(const GURL& icon_url, const SkBitmap& icon);
// Looks up the original, online URL of the site requested. The URL from the
// WebContents may be an offline page or a distilled article which is not
« no previous file with comments | « chrome/browser/android/shortcut_helper.cc ('k') | chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698