| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 296 } |
| 297 | 297 |
| 298 bool AppBannerInfoBarDelegateAndroid::AcceptWebApk( | 298 bool AppBannerInfoBarDelegateAndroid::AcceptWebApk( |
| 299 content::WebContents* web_contents) { | 299 content::WebContents* web_contents) { |
| 300 if (IsInfoEmpty(shortcut_info_)) | 300 if (IsInfoEmpty(shortcut_info_)) |
| 301 return true; | 301 return true; |
| 302 | 302 |
| 303 JNIEnv* env = base::android::AttachCurrentThread(); | 303 JNIEnv* env = base::android::AttachCurrentThread(); |
| 304 | 304 |
| 305 // If the WebAPK is installed and the "Open" button is clicked, open the | 305 // If the WebAPK is installed and the "Open" button is clicked, open the |
| 306 // WebAPK. | 306 // WebAPK. Do not send a BannerAccepted message. |
| 307 if (install_state_ == INSTALLED) { | 307 if (install_state_ == INSTALLED) { |
| 308 Java_AppBannerInfoBarDelegateAndroid_openWebApk(env, java_delegate_); | 308 Java_AppBannerInfoBarDelegateAndroid_openWebApk(env, java_delegate_); |
| 309 webapk::TrackUserAction(webapk::USER_ACTION_INSTALLED_OPEN); | 309 webapk::TrackUserAction(webapk::USER_ACTION_INSTALLED_OPEN); |
| 310 SendBannerAccepted(); | |
| 311 return true; | 310 return true; |
| 312 } | 311 } |
| 313 | 312 |
| 314 install_state_ = INSTALLING; | 313 install_state_ = INSTALLING; |
| 315 webapk::TrackInstallSource(webapk_install_source_); | 314 webapk::TrackInstallSource(webapk_install_source_); |
| 316 | 315 |
| 317 if (TriggeredFromBanner()) { | 316 if (TriggeredFromBanner()) { |
| 318 TrackUserResponse(USER_RESPONSE_WEB_APP_ACCEPTED); | 317 TrackUserResponse(USER_RESPONSE_WEB_APP_ACCEPTED); |
| 319 AppBannerSettingsHelper::RecordBannerInstallEvent( | 318 AppBannerSettingsHelper::RecordBannerInstallEvent( |
| 320 web_contents, shortcut_info_->url.spec(), AppBannerSettingsHelper::WEB); | 319 web_contents, shortcut_info_->url.spec(), AppBannerSettingsHelper::WEB); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 467 |
| 469 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 468 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
| 470 return true; | 469 return true; |
| 471 } | 470 } |
| 472 | 471 |
| 473 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 472 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
| 474 return RegisterNativesImpl(env); | 473 return RegisterNativesImpl(env); |
| 475 } | 474 } |
| 476 | 475 |
| 477 } // namespace banners | 476 } // namespace banners |
| OLD | NEW |