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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 weak_manager_->SendBannerAccepted(event_request_id_); | 371 weak_manager_->SendBannerAccepted(event_request_id_); |
372 // TODO(mgiuca): Send the appinstalled event for WebAPKs (but just removing | 372 // TODO(mgiuca): Send the appinstalled event for WebAPKs (but just removing |
373 // this check won't be sufficient). | 373 // this check won't be sufficient). |
374 if (!is_webapk_) | 374 if (!is_webapk_) |
375 weak_manager_->OnInstall(); | 375 weak_manager_->OnInstall(); |
376 } | 376 } |
377 } | 377 } |
378 | 378 |
379 void AppBannerInfoBarDelegateAndroid::OnWebApkInstallFinished( | 379 void AppBannerInfoBarDelegateAndroid::OnWebApkInstallFinished( |
380 bool success, | 380 bool success, |
381 const std::string& webapk_package_name) { | 381 const std::string& webapk_package_name, |
382 bool less_updates) { | |
dominickn
2017/02/14 04:13:34
relax_updates
Xi Han
2017/02/14 22:25:46
Done.
| |
382 JNIEnv* env = base::android::AttachCurrentThread(); | 383 JNIEnv* env = base::android::AttachCurrentThread(); |
383 if (!success) { | 384 if (!success) { |
384 DVLOG(1) << "The WebAPK installation failed."; | 385 DVLOG(1) << "The WebAPK installation failed."; |
385 Java_AppBannerInfoBarDelegateAndroid_showWebApkInstallFailureToast(env); | 386 Java_AppBannerInfoBarDelegateAndroid_showWebApkInstallFailureToast(env); |
386 webapk::TrackInstallEvent(webapk::INSTALL_FAILED); | 387 webapk::TrackInstallEvent(webapk::INSTALL_FAILED); |
387 if (infobar()) | 388 if (infobar()) |
388 infobar()->RemoveSelf(); | 389 infobar()->RemoveSelf(); |
389 return; | 390 return; |
390 } | 391 } |
391 | 392 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
469 | 470 |
470 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 471 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
471 return true; | 472 return true; |
472 } | 473 } |
473 | 474 |
474 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 475 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
475 return RegisterNativesImpl(env); | 476 return RegisterNativesImpl(env); |
476 } | 477 } |
477 | 478 |
478 } // namespace banners | 479 } // namespace banners |
OLD | NEW |