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

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc

Issue 2064943002: Pass in extra parameters to WebApkBuilder#buildWebApkAsync() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_manifest Created 4 years, 6 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_dialog_helper.cc
diff --git a/chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc b/chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc
index bc55cb26db57533d4050e4ae37e0a09bc64cecdf..677c790038cac29fd3ae740c9f92c95d1a704290 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc
+++ b/chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc
@@ -64,18 +64,18 @@ void AddToHomescreenDialogHelper::OnUserTitleAvailable(
}
void AddToHomescreenDialogHelper::OnDataAvailable(const ShortcutInfo& info,
+ const GURL& icon_url,
const SkBitmap& icon) {
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jobject> java_bitmap;
if (icon.getSize())
java_bitmap = gfx::ConvertToJavaBitmap(&icon);
- Java_AddToHomescreenDialogHelper_onIconAvailable(env,
- java_ref_.obj(),
- java_bitmap.obj());
+ Java_AddToHomescreenDialogHelper_onIconAvailable(env, java_ref_.obj(),
+ java_bitmap.obj());
if (add_shortcut_pending_)
- AddShortcut(info, icon);
+ AddShortcut(info, icon_url, icon);
}
void AddToHomescreenDialogHelper::Destroy(JNIEnv* env,
@@ -106,11 +106,14 @@ void AddToHomescreenDialogHelper::AddShortcut(
if (data_fetcher_->is_ready()) {
// If the fetcher isn't ready yet, the shortcut will be added when it is
// via OnDataAvailable();
- AddShortcut(data_fetcher_->shortcut_info(), data_fetcher_->shortcut_icon());
+ AddShortcut(data_fetcher_->shortcut_info(),
+ data_fetcher_->shortcut_icon_url(),
+ data_fetcher_->shortcut_icon());
}
}
void AddToHomescreenDialogHelper::AddShortcut(const ShortcutInfo& info,
+ const GURL& icon_url,
const SkBitmap& icon) {
DCHECK(add_shortcut_pending_);
if (!add_shortcut_pending_)
@@ -123,7 +126,7 @@ void AddToHomescreenDialogHelper::AddShortcut(const ShortcutInfo& info,
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap, info,
- uid, icon,
+ uid, icon_url, icon,
data_fetcher_->FetchSplashScreenImageCallback(uid)));
}

Powered by Google App Engine
This is Rietveld 408576698