| 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::AddShortcutInBackgroundWithSkBitmap, |
| 264 uid, *app_icon_.get(), | 264 web_contents->GetBrowserContext(), info, uid, |
| 265 *app_icon_.get(), |
| 265 data_fetcher_->FetchWebappSplashScreenImageCallback(uid))); | 266 data_fetcher_->FetchWebappSplashScreenImageCallback(uid))); |
| 266 | 267 |
| 267 SendBannerAccepted(web_contents, "web"); | 268 SendBannerAccepted(web_contents, "web"); |
| 268 return true; | 269 return true; |
| 269 } | 270 } |
| 270 | 271 |
| 271 return true; | 272 return true; |
| 272 } | 273 } |
| 273 | 274 |
| 274 bool AppBannerInfoBarDelegateAndroid::LinkClicked( | 275 bool AppBannerInfoBarDelegateAndroid::LinkClicked( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 295 | 296 |
| 296 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 297 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
| 297 return true; | 298 return true; |
| 298 } | 299 } |
| 299 | 300 |
| 300 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 301 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
| 301 return RegisterNativesImpl(env); | 302 return RegisterNativesImpl(env); |
| 302 } | 303 } |
| 303 | 304 |
| 304 } // namespace banners | 305 } // namespace banners |
| OLD | NEW |