| 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 #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 Loading... |
| 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 Loading... |
| 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 bool relax_updates, | 130 bool relax_updates, |
| 130 const std::string& webapk_package_name); | 131 const std::string& webapk_package_name); |
| 131 | 132 |
| 132 // Called when a WebAPK install fails. | 133 // Called when a WebAPK install fails. |
| 133 void OnWebApkInstallFailed(); | 134 void OnWebApkInstallFailed(WebApkInstallResult result); |
| 134 | 135 |
| 135 void TrackWebApkInstallationDismissEvents(InstallState install_state); | 136 void TrackWebApkInstallationDismissEvents(InstallState install_state); |
| 136 | 137 |
| 137 // ConfirmInfoBarDelegate: | 138 // ConfirmInfoBarDelegate: |
| 138 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | 139 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| 139 gfx::Image GetIcon() const override; | 140 gfx::Image GetIcon() const override; |
| 140 void InfoBarDismissed() override; | 141 void InfoBarDismissed() override; |
| 141 base::string16 GetMessageText() const override; | 142 base::string16 GetMessageText() const override; |
| 142 int GetButtons() const override; | 143 int GetButtons() const override; |
| 143 bool LinkClicked(WindowOpenDisposition disposition) override; | 144 bool LinkClicked(WindowOpenDisposition disposition) override; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 177 |
| 177 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); | 178 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); |
| 178 }; | 179 }; |
| 179 | 180 |
| 180 // Register native methods. | 181 // Register native methods. |
| 181 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); | 182 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); |
| 182 | 183 |
| 183 } // namespace banners | 184 } // namespace banners |
| 184 | 185 |
| 185 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ | 186 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| OLD | NEW |