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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 AppBannerSettingsHelper::RecordBannerInstallEvent( | 246 AppBannerSettingsHelper::RecordBannerInstallEvent( |
247 web_contents, web_app_data_.start_url.spec(), | 247 web_contents, web_app_data_.start_url.spec(), |
248 AppBannerSettingsHelper::WEB); | 248 AppBannerSettingsHelper::WEB); |
249 | 249 |
250 ShortcutInfo info(GURL::EmptyGURL()); | 250 ShortcutInfo info(GURL::EmptyGURL()); |
251 info.UpdateFromManifest(web_app_data_); | 251 info.UpdateFromManifest(web_app_data_); |
252 info.UpdateSource(ShortcutInfo::SOURCE_APP_BANNER); | 252 info.UpdateSource(ShortcutInfo::SOURCE_APP_BANNER); |
253 | 253 |
254 const std::string& uid = base::GenerateGUID(); | 254 const std::string& uid = base::GenerateGUID(); |
255 content::BrowserThread::PostTask( | 255 content::BrowserThread::PostTask( |
256 content::BrowserThread::IO, | 256 content::BrowserThread::IO, FROM_HERE, |
257 FROM_HERE, | 257 base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap, info, |
258 base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap, | 258 uid, *app_icon_.get(), |
259 info, | 259 data_fetcher_->FetchWebappSplashScreenImageCallback(uid))); |
260 uid, | |
261 *app_icon_.get())); | |
262 data_fetcher_->FetchWebappSplashScreenImage(uid); | |
263 | 260 |
264 SendBannerAccepted(web_contents, "web"); | 261 SendBannerAccepted(web_contents, "web"); |
265 return true; | 262 return true; |
266 } | 263 } |
267 | 264 |
268 return true; | 265 return true; |
269 } | 266 } |
270 | 267 |
271 bool AppBannerInfoBarDelegateAndroid::LinkClicked( | 268 bool AppBannerInfoBarDelegateAndroid::LinkClicked( |
272 WindowOpenDisposition disposition) { | 269 WindowOpenDisposition disposition) { |
(...skipping 19 matching lines...) Expand all Loading... |
292 | 289 |
293 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 290 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
294 return true; | 291 return true; |
295 } | 292 } |
296 | 293 |
297 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 294 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
298 return RegisterNativesImpl(env); | 295 return RegisterNativesImpl(env); |
299 } | 296 } |
300 | 297 |
301 } // namespace banners | 298 } // namespace banners |
OLD | NEW |