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

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

Issue 2675803004: Fall back to shortcut A2HS when Phonesky is out of date or unavailable. (Closed)
Patch Set: Update add_to_homescreen_data_fetcher_unittest.cc. 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 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_
6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 24 matching lines...) Expand all
35 public: 35 public:
36 // Creates an infobar and delegate for promoting the installation of a web 36 // Creates an infobar and delegate for promoting the installation of a web
37 // app, and adds the infobar to the InfoBarManager for |web_contents|. 37 // app, and adds the infobar to the InfoBarManager for |web_contents|.
38 static bool Create( 38 static bool Create(
39 content::WebContents* web_contents, 39 content::WebContents* web_contents,
40 base::WeakPtr<AppBannerManager> weak_manager, 40 base::WeakPtr<AppBannerManager> weak_manager,
41 const base::string16& app_title, 41 const base::string16& app_title,
42 std::unique_ptr<ShortcutInfo> info, 42 std::unique_ptr<ShortcutInfo> info,
43 std::unique_ptr<SkBitmap> icon, 43 std::unique_ptr<SkBitmap> icon,
44 int event_request_id, 44 int event_request_id,
45 bool can_use_webapk_install_flow,
45 webapk::InstallSource webapk_install_source); 46 webapk::InstallSource webapk_install_source);
46 47
47 // Creates an infobar and delegate for promoting the installation of an 48 // Creates an infobar and delegate for promoting the installation of an
48 // Android app, and adds the infobar to the InfoBarManager for |web_contents|. 49 // Android app, and adds the infobar to the InfoBarManager for |web_contents|.
49 static bool Create( 50 static bool Create(
50 content::WebContents* web_contents, 51 content::WebContents* web_contents,
51 const base::string16& app_title, 52 const base::string16& app_title,
52 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, 53 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data,
53 std::unique_ptr<SkBitmap> icon, 54 std::unique_ptr<SkBitmap> icon,
54 const std::string& native_app_package, 55 const std::string& native_app_package,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 91
91 // Delegate for promoting a web app. 92 // Delegate for promoting a web app.
92 AppBannerInfoBarDelegateAndroid( 93 AppBannerInfoBarDelegateAndroid(
93 base::WeakPtr<AppBannerManager> weak_manager, 94 base::WeakPtr<AppBannerManager> weak_manager,
94 const base::string16& app_title, 95 const base::string16& app_title,
95 std::unique_ptr<ShortcutInfo> info, 96 std::unique_ptr<ShortcutInfo> info,
96 std::unique_ptr<SkBitmap> icon, 97 std::unique_ptr<SkBitmap> icon,
97 int event_request_id, 98 int event_request_id,
98 bool is_webapk, 99 bool is_webapk,
99 bool is_webapk_already_installed, 100 bool is_webapk_already_installed,
101 const std::string& webapk_package_name,
100 webapk::InstallSource webapk_install_source); 102 webapk::InstallSource webapk_install_source);
101 103
102 // Delegate for promoting an Android app. 104 // Delegate for promoting an Android app.
103 AppBannerInfoBarDelegateAndroid( 105 AppBannerInfoBarDelegateAndroid(
104 const base::string16& app_title, 106 const base::string16& app_title,
105 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, 107 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data,
106 std::unique_ptr<SkBitmap> icon, 108 std::unique_ptr<SkBitmap> icon,
107 const std::string& native_app_package, 109 const std::string& native_app_package,
108 const std::string& referrer, 110 const std::string& referrer,
109 int event_request_id); 111 int event_request_id);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 std::unique_ptr<SkBitmap> icon_; 148 std::unique_ptr<SkBitmap> icon_;
147 149
148 std::string native_app_package_; 150 std::string native_app_package_;
149 std::string referrer_; 151 std::string referrer_;
150 int event_request_id_; 152 int event_request_id_;
151 bool has_user_interaction_; 153 bool has_user_interaction_;
152 154
153 bool is_webapk_; 155 bool is_webapk_;
154 bool is_webapk_already_installed_; 156 bool is_webapk_already_installed_;
155 157
158 // The package name of WebAPK if WebAPK has been installed.
159 std::string webapk_package_name_;
160
156 // Indicates the current state of a WebAPK installation. 161 // Indicates the current state of a WebAPK installation.
157 InstallState install_state_; 162 InstallState install_state_;
158 163
159 // Indicates the way in which a WebAPK (if applicable) is installed: from the 164 // Indicates the way in which a WebAPK (if applicable) is installed: from the
160 // menu or from an app banner. 165 // menu or from an app banner.
161 webapk::InstallSource webapk_install_source_; 166 webapk::InstallSource webapk_install_source_;
162 167
163 base::WeakPtrFactory<AppBannerInfoBarDelegateAndroid> weak_ptr_factory_; 168 base::WeakPtrFactory<AppBannerInfoBarDelegateAndroid> weak_ptr_factory_;
164 169
165 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); 170 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid);
166 }; 171 };
167 172
168 // Register native methods. 173 // Register native methods.
169 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); 174 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env);
170 175
171 } // namespace banners 176 } // namespace banners
172 177
173 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ 178 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698