OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" | 5 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 ShortcutInfo info(GURL::EmptyGURL()); | 256 ShortcutInfo info(GURL::EmptyGURL()); |
257 info.UpdateFromManifest(manifest_); | 257 info.UpdateFromManifest(manifest_); |
258 info.manifest_url = manifest_url_; | 258 info.manifest_url = manifest_url_; |
259 info.icon_url = app_icon_url_; | 259 info.icon_url = app_icon_url_; |
260 info.UpdateSource(ShortcutInfo::SOURCE_APP_BANNER); | 260 info.UpdateSource(ShortcutInfo::SOURCE_APP_BANNER); |
261 | 261 |
262 const std::string& uid = base::GenerateGUID(); | 262 const std::string& uid = base::GenerateGUID(); |
263 content::BrowserThread::PostTask( | 263 content::BrowserThread::PostTask( |
264 content::BrowserThread::IO, FROM_HERE, | 264 content::BrowserThread::IO, FROM_HERE, |
265 base::Bind(&ShortcutHelper::AddToLauncherInBackgroundWithSkBitmap, info, | 265 base::Bind(&ShortcutHelper::AddToLauncherInBackgroundWithSkBitmap, |
266 uid, *app_icon_.get(), | 266 web_contents->GetBrowserContext(), info, uid, |
| 267 *app_icon_.get(), |
267 data_fetcher_->FetchWebappSplashScreenImageCallback(uid))); | 268 data_fetcher_->FetchWebappSplashScreenImageCallback(uid))); |
268 | 269 |
269 SendBannerAccepted(web_contents, "web"); | 270 SendBannerAccepted(web_contents, "web"); |
270 return true; | 271 return true; |
271 } | 272 } |
272 | 273 |
273 return true; | 274 return true; |
274 } | 275 } |
275 | 276 |
276 bool AppBannerInfoBarDelegateAndroid::LinkClicked( | 277 bool AppBannerInfoBarDelegateAndroid::LinkClicked( |
(...skipping 20 matching lines...) Expand all Loading... |
297 | 298 |
298 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 299 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
299 return true; | 300 return true; |
300 } | 301 } |
301 | 302 |
302 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 303 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
303 return RegisterNativesImpl(env); | 304 return RegisterNativesImpl(env); |
304 } | 305 } |
305 | 306 |
306 } // namespace banners | 307 } // namespace banners |
OLD | NEW |