| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 const std::string& native_app_package, | 54 const std::string& native_app_package, |
| 55 const std::string& referrer, | 55 const std::string& referrer, |
| 56 int event_request_id); | 56 int event_request_id); |
| 57 | 57 |
| 58 ~AppBannerInfoBarDelegateAndroid() override; | 58 ~AppBannerInfoBarDelegateAndroid() override; |
| 59 | 59 |
| 60 // Called when the AppBannerInfoBarAndroid's button needs to be updated. | 60 // Called when the AppBannerInfoBarAndroid's button needs to be updated. |
| 61 void UpdateInstallState(JNIEnv* env, | 61 void UpdateInstallState(JNIEnv* env, |
| 62 const base::android::JavaParamRef<jobject>& obj); | 62 const base::android::JavaParamRef<jobject>& obj); |
| 63 | 63 |
| 64 // Called when the installation Intent has been handled and focus has been | 64 // Called when the native app installation Intent has been handled and focus |
| 65 // returned to Chrome. | 65 // has been returned to Chrome. |
| 66 void OnInstallIntentReturned(JNIEnv* env, | 66 void OnInstallIntentReturned(JNIEnv* env, |
| 67 const base::android::JavaParamRef<jobject>& obj, | 67 const base::android::JavaParamRef<jobject>& obj, |
| 68 jboolean jis_installing); | 68 jboolean jis_installing); |
| 69 | 69 |
| 70 // Called when the InstallerDelegate task has finished. | 70 // Called when the native app InstallerDelegate task has finished. |
| 71 void OnInstallFinished(JNIEnv* env, | 71 void OnInstallFinished(JNIEnv* env, |
| 72 const base::android::JavaParamRef<jobject>& obj, | 72 const base::android::JavaParamRef<jobject>& obj, |
| 73 jboolean success); | 73 jboolean success); |
| 74 | 74 |
| 75 // ConfirmInfoBarDelegate: | 75 // ConfirmInfoBarDelegate: |
| 76 bool Accept() override; | 76 bool Accept() override; |
| 77 | 77 |
| 78 // Update the AppBannerInfoBarAndroid with installed WebAPK's information. | 78 // Update the AppBannerInfoBarAndroid with installed WebAPK's information. |
| 79 void UpdateStateForInstalledWebAPK(const std::string& webapk_package_name); | 79 void UpdateStateForInstalledWebAPK(const std::string& webapk_package_name); |
| 80 | 80 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 110 | 110 |
| 111 void CreateJavaDelegate(); | 111 void CreateJavaDelegate(); |
| 112 bool AcceptNativeApp(content::WebContents* web_contents); | 112 bool AcceptNativeApp(content::WebContents* web_contents); |
| 113 bool AcceptWebApp(content::WebContents* web_contents); | 113 bool AcceptWebApp(content::WebContents* web_contents); |
| 114 | 114 |
| 115 // Called when the OK button on a WebAPK infobar is pressed. If the WebAPK is | 115 // Called when the OK button on a WebAPK infobar is pressed. If the WebAPK is |
| 116 // already installed, opens it; otherwise, installs it. Returns whether the | 116 // already installed, opens it; otherwise, installs it. Returns whether the |
| 117 // infobar should be closed as a result of the button press. | 117 // infobar should be closed as a result of the button press. |
| 118 bool AcceptWebApk(content::WebContents* web_contents); | 118 bool AcceptWebApk(content::WebContents* web_contents); |
| 119 | 119 |
| 120 // Returns false if this delegate is for a WebAPK and was triggered from the |
| 121 // A2HS menu item. Otherwise returns true. |
| 122 bool TriggeredFromBanner() const; |
| 120 void SendBannerAccepted(); | 123 void SendBannerAccepted(); |
| 121 void OnWebApkInstallFinished(bool success, | 124 void OnWebApkInstallFinished(bool success, |
| 122 const std::string& webapk_package_name); | 125 const std::string& webapk_package_name); |
| 123 void TrackWebApkInstallationDismissEvents(InstallState install_state); | 126 void TrackWebApkInstallationDismissEvents(InstallState install_state); |
| 124 | 127 |
| 125 // ConfirmInfoBarDelegate: | 128 // ConfirmInfoBarDelegate: |
| 126 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | 129 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| 127 gfx::Image GetIcon() const override; | 130 gfx::Image GetIcon() const override; |
| 128 void InfoBarDismissed() override; | 131 void InfoBarDismissed() override; |
| 129 base::string16 GetMessageText() const override; | 132 base::string16 GetMessageText() const override; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 164 |
| 162 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); | 165 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); |
| 163 }; | 166 }; |
| 164 | 167 |
| 165 // Register native methods. | 168 // Register native methods. |
| 166 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); | 169 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); |
| 167 | 170 |
| 168 } // namespace banners | 171 } // namespace banners |
| 169 | 172 |
| 170 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ | 173 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| OLD | NEW |