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/location.h" | 9 #include "base/location.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 } | 208 } |
209 SendBannerAccepted(web_contents, "play"); | 209 SendBannerAccepted(web_contents, "play"); |
210 return was_opened; | 210 return was_opened; |
211 } else if (!web_app_data_.IsEmpty()) { | 211 } else if (!web_app_data_.IsEmpty()) { |
212 AppBannerSettingsHelper::RecordBannerInstallEvent( | 212 AppBannerSettingsHelper::RecordBannerInstallEvent( |
213 web_contents, web_app_data_.start_url.spec(), | 213 web_contents, web_app_data_.start_url.spec(), |
214 AppBannerSettingsHelper::WEB); | 214 AppBannerSettingsHelper::WEB); |
215 | 215 |
216 ShortcutInfo info; | 216 ShortcutInfo info; |
217 info.UpdateFromManifest(web_app_data_); | 217 info.UpdateFromManifest(web_app_data_); |
| 218 info.UpdateSource(ShortcutInfo::SOURCE_APP_BANNER); |
218 content::BrowserThread::PostTask( | 219 content::BrowserThread::PostTask( |
219 content::BrowserThread::IO, | 220 content::BrowserThread::IO, |
220 FROM_HERE, | 221 FROM_HERE, |
221 base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap, | 222 base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap, |
222 info, | 223 info, |
223 *app_icon_.get())); | 224 *app_icon_.get())); |
224 | 225 |
225 SendBannerAccepted(web_contents, "web"); | 226 SendBannerAccepted(web_contents, "web"); |
226 return true; | 227 return true; |
227 } | 228 } |
(...skipping 25 matching lines...) Expand all Loading... |
253 | 254 |
254 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 255 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
255 return true; | 256 return true; |
256 } | 257 } |
257 | 258 |
258 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 259 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
259 return RegisterNativesImpl(env); | 260 return RegisterNativesImpl(env); |
260 } | 261 } |
261 | 262 |
262 } // namespace banners | 263 } // namespace banners |
OLD | NEW |