| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 ShortcutInfo info(GURL::EmptyGURL()); | 254 ShortcutInfo info(GURL::EmptyGURL()); |
| 255 info.UpdateFromManifest(manifest_); | 255 info.UpdateFromManifest(manifest_); |
| 256 info.manifest_url = manifest_url_; | 256 info.manifest_url = manifest_url_; |
| 257 info.icon_url = app_icon_url_; | 257 info.icon_url = app_icon_url_; |
| 258 info.UpdateSource(ShortcutInfo::SOURCE_APP_BANNER); | 258 info.UpdateSource(ShortcutInfo::SOURCE_APP_BANNER); |
| 259 | 259 |
| 260 const std::string& uid = base::GenerateGUID(); | 260 const std::string& uid = base::GenerateGUID(); |
| 261 content::BrowserThread::PostTask( | 261 content::BrowserThread::PostTask( |
| 262 content::BrowserThread::IO, FROM_HERE, | 262 content::BrowserThread::IO, FROM_HERE, |
| 263 base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap, info, | 263 base::Bind(&ShortcutHelper::AddToLauncherInBackgroundWithSkBitmap, info, |
| 264 uid, *app_icon_.get(), | 264 uid, *app_icon_.get(), |
| 265 data_fetcher_->FetchWebappSplashScreenImageCallback(uid))); | 265 data_fetcher_->FetchWebappSplashScreenImageCallback(uid))); |
| 266 | 266 |
| 267 SendBannerAccepted(web_contents, "web"); | 267 SendBannerAccepted(web_contents, "web"); |
| 268 return true; | 268 return true; |
| 269 } | 269 } |
| 270 | 270 |
| 271 return true; | 271 return true; |
| 272 } | 272 } |
| 273 | 273 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 295 | 295 |
| 296 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 296 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
| 297 return true; | 297 return true; |
| 298 } | 298 } |
| 299 | 299 |
| 300 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 300 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
| 301 return RegisterNativesImpl(env); | 301 return RegisterNativesImpl(env); |
| 302 } | 302 } |
| 303 | 303 |
| 304 } // namespace banners | 304 } // namespace banners |
| OLD | NEW |