| 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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 weak_manager_->SendBannerAccepted(event_request_id_); | 367 weak_manager_->SendBannerAccepted(event_request_id_); |
| 368 // TODO(mgiuca): Send the appinstalled event for WebAPKs (but just removing | 368 // TODO(mgiuca): Send the appinstalled event for WebAPKs (but just removing |
| 369 // this check won't be sufficient). | 369 // this check won't be sufficient). |
| 370 if (!is_webapk_) | 370 if (!is_webapk_) |
| 371 weak_manager_->OnInstall(); | 371 weak_manager_->OnInstall(); |
| 372 } | 372 } |
| 373 } | 373 } |
| 374 | 374 |
| 375 void AppBannerInfoBarDelegateAndroid::OnWebApkInstallFinished( | 375 void AppBannerInfoBarDelegateAndroid::OnWebApkInstallFinished( |
| 376 bool success, | 376 bool success, |
| 377 bool relax_updates, |
| 377 const std::string& webapk_package_name) { | 378 const std::string& webapk_package_name) { |
| 378 if (!success) { | 379 if (!success) { |
| 379 OnWebApkInstallFailed(); | 380 OnWebApkInstallFailed(); |
| 380 return; | 381 return; |
| 381 } | 382 } |
| 382 UpdateStateForInstalledWebAPK(webapk_package_name); | 383 UpdateStateForInstalledWebAPK(webapk_package_name); |
| 383 webapk::TrackInstallDuration(timer_->Elapsed()); | 384 webapk::TrackInstallDuration(timer_->Elapsed()); |
| 384 timer_.reset(); | 385 timer_.reset(); |
| 385 webapk::TrackInstallEvent(webapk::INSTALL_COMPLETED); | 386 webapk::TrackInstallEvent(webapk::INSTALL_COMPLETED); |
| 386 } | 387 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 482 |
| 482 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 483 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
| 483 return true; | 484 return true; |
| 484 } | 485 } |
| 485 | 486 |
| 486 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 487 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
| 487 return RegisterNativesImpl(env); | 488 return RegisterNativesImpl(env); |
| 488 } | 489 } |
| 489 | 490 |
| 490 } // namespace banners | 491 } // namespace banners |
| OLD | NEW |