| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // static | 48 // static |
| 49 bool AppBannerInfoBarDelegateAndroid::Create( | 49 bool AppBannerInfoBarDelegateAndroid::Create( |
| 50 content::WebContents* web_contents, | 50 content::WebContents* web_contents, |
| 51 base::WeakPtr<AppBannerManager> weak_manager, | 51 base::WeakPtr<AppBannerManager> weak_manager, |
| 52 const base::string16& app_title, | 52 const base::string16& app_title, |
| 53 std::unique_ptr<ShortcutInfo> shortcut_info, | 53 std::unique_ptr<ShortcutInfo> shortcut_info, |
| 54 std::unique_ptr<SkBitmap> icon, | 54 std::unique_ptr<SkBitmap> icon, |
| 55 int event_request_id, | 55 int event_request_id, |
| 56 webapk::InstallSource webapk_install_source) { | 56 webapk::InstallSource webapk_install_source) { |
| 57 bool is_webapk = ChromeWebApkHost::AreWebApkEnabled(); | 57 bool is_webapk = ChromeWebApkHost::CanInstallWebApk(); |
| 58 std::string webapk_package_name = ""; | 58 std::string webapk_package_name = ""; |
| 59 const GURL& url = shortcut_info->url; | 59 const GURL& url = shortcut_info->url; |
| 60 if (is_webapk) | 60 if (is_webapk) |
| 61 webapk_package_name = ShortcutHelper::QueryWebApkPackage(url); | 61 webapk_package_name = ShortcutHelper::QueryWebApkPackage(url); |
| 62 bool is_webapk_already_installed = !webapk_package_name.empty(); | 62 bool is_webapk_already_installed = !webapk_package_name.empty(); |
| 63 auto infobar_delegate = | 63 auto infobar_delegate = |
| 64 base::WrapUnique(new banners::AppBannerInfoBarDelegateAndroid( | 64 base::WrapUnique(new banners::AppBannerInfoBarDelegateAndroid( |
| 65 weak_manager, app_title, std::move(shortcut_info), std::move(icon), | 65 weak_manager, app_title, std::move(shortcut_info), std::move(icon), |
| 66 event_request_id, is_webapk, is_webapk_already_installed, | 66 event_request_id, is_webapk, is_webapk_already_installed, |
| 67 webapk_install_source)); | 67 webapk_install_source)); |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 469 |
| 470 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); | 470 TrackDismissEvent(DISMISS_EVENT_BANNER_CLICK); |
| 471 return true; | 471 return true; |
| 472 } | 472 } |
| 473 | 473 |
| 474 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { | 474 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env) { |
| 475 return RegisterNativesImpl(env); | 475 return RegisterNativesImpl(env); |
| 476 } | 476 } |
| 477 | 477 |
| 478 } // namespace banners | 478 } // namespace banners |
| OLD | NEW |