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

Unified Diff: chrome/browser/android/banners/app_banner_infobar_delegate_android.cc

Issue 1310223002: webapps: initial addition of splash screen icon downloading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webapps-database-exp
Patch Set: Fix compile Created 5 years, 3 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/banners/app_banner_infobar_delegate_android.cc
diff --git a/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc b/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
index 93bc0fa9dc03ececabda86f6e3f2c6a4f4d42123..ad246a70039d0daf082d188ac825d1830b6a23cc 100644
--- a/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
+++ b/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
@@ -6,6 +6,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
+#include "base/guid.h"
#include "base/location.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
@@ -38,10 +39,12 @@ namespace banners {
AppBannerInfoBarDelegateAndroid::AppBannerInfoBarDelegateAndroid(
int event_request_id,
+ scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher,
const base::string16& app_title,
SkBitmap* app_icon,
const content::Manifest& web_app_data)
- : app_title_(app_title),
+ : data_fetcher_(data_fetcher),
+ app_title_(app_title),
app_icon_(app_icon),
event_request_id_(event_request_id),
web_app_data_(web_app_data),
@@ -240,12 +243,16 @@ bool AppBannerInfoBarDelegateAndroid::Accept() {
ShortcutInfo info(GURL::EmptyGURL());
info.UpdateFromManifest(web_app_data_);
info.UpdateSource(ShortcutInfo::SOURCE_APP_BANNER);
+
+ const std::string& uid = base::GenerateGUID();
content::BrowserThread::PostTask(
content::BrowserThread::IO,
FROM_HERE,
base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap,
info,
+ uid,
*app_icon_.get()));
+ data_fetcher_->FetchWebappSplashScreenImage(uid);
SendBannerAccepted(web_contents, "web");
return true;

Powered by Google App Engine
This is Rietveld 408576698