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

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

Issue 2733543002: [Android:WebAPK] Don't add webapp to homescreen if WebAPK install times out part 1/3 (Closed)
Patch Set: Merge branch 'refactor_shortcut_helper29' into refactor_shortcut_helper3 Created 3 years, 9 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 10 matching lines...) Expand all
21 } 21 }
22 22
23 namespace content { 23 namespace content {
24 class WebContents; 24 class WebContents;
25 } 25 }
26 26
27 namespace infobars { 27 namespace infobars {
28 class InfoBarManager; 28 class InfoBarManager;
29 } 29 }
30 30
31 enum class WebApkInstallResult;
31 struct ShortcutInfo; 32 struct ShortcutInfo;
32 33
33 namespace banners { 34 namespace banners {
34 35
35 class AppBannerManager; 36 class AppBannerManager;
36 37
37 // Manages installation of an app being promoted by a page. 38 // Manages installation of an app being promoted by a page.
38 class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { 39 class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate {
39 public: 40 public:
40 // Creates an infobar and delegate for promoting the installation of a web 41 // Creates an infobar and delegate for promoting the installation of a web
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 119
119 // Called when the OK button on a WebAPK infobar is pressed. If the WebAPK is 120 // Called when the OK button on a WebAPK infobar is pressed. If the WebAPK is
120 // already installed, opens it; otherwise, installs it. Returns whether the 121 // already installed, opens it; otherwise, installs it. Returns whether the
121 // infobar should be closed as a result of the button press. 122 // infobar should be closed as a result of the button press.
122 bool AcceptWebApk(content::WebContents* web_contents); 123 bool AcceptWebApk(content::WebContents* web_contents);
123 124
124 // Returns false if this delegate is for a WebAPK and was triggered from the 125 // Returns false if this delegate is for a WebAPK and was triggered from the
125 // A2HS menu item. Otherwise returns true. 126 // A2HS menu item. Otherwise returns true.
126 bool TriggeredFromBanner() const; 127 bool TriggeredFromBanner() const;
127 void SendBannerAccepted(); 128 void SendBannerAccepted();
128 void OnWebApkInstallFinished(bool success, 129 void OnWebApkInstallFinished(WebApkInstallResult result,
129 const std::string& webapk_package_name); 130 const std::string& webapk_package_name);
130 131
131 // Called when a WebAPK install fails. 132 // Called when a WebAPK install fails.
132 void OnWebApkInstallFailed(); 133 void OnWebApkInstallFailed(WebApkInstallResult result);
133 134
134 void TrackWebApkInstallationDismissEvents(InstallState install_state); 135 void TrackWebApkInstallationDismissEvents(InstallState install_state);
135 136
136 // ConfirmInfoBarDelegate: 137 // ConfirmInfoBarDelegate:
137 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; 138 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
138 gfx::Image GetIcon() const override; 139 gfx::Image GetIcon() const override;
139 void InfoBarDismissed() override; 140 void InfoBarDismissed() override;
140 base::string16 GetMessageText() const override; 141 base::string16 GetMessageText() const override;
141 int GetButtons() const override; 142 int GetButtons() const override;
142 bool LinkClicked(WindowOpenDisposition disposition) override; 143 bool LinkClicked(WindowOpenDisposition disposition) override;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 176
176 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); 177 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid);
177 }; 178 };
178 179
179 // Register native methods. 180 // Register native methods.
180 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); 181 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env);
181 182
182 } // namespace banners 183 } // namespace banners
183 184
184 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ 185 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698