Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Side by Side Diff: chrome/browser/android/banners/app_banner_infobar_delegate_android.cc

Issue 2675803004: Fall back to shortcut A2HS when Phonesky is out of date or unavailable. (Closed)
Patch Set: Rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698