| 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> |
| 9 #include <string> |
| 10 |
| 8 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/macros.h" | 12 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 11 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 12 #include "chrome/browser/android/webapk/webapk_metrics.h" | 15 #include "chrome/browser/android/webapk/webapk_metrics.h" |
| 13 #include "chrome/browser/banners/app_banner_manager.h" | 16 #include "chrome/browser/banners/app_banner_manager.h" |
| 14 #include "components/infobars/core/confirm_infobar_delegate.h" | 17 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 15 #include "ui/gfx/image/image.h" | 18 #include "ui/gfx/image/image.h" |
| 16 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 17 | 20 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 bool AcceptNativeApp(content::WebContents* web_contents); | 111 bool AcceptNativeApp(content::WebContents* web_contents); |
| 109 bool AcceptWebApp(content::WebContents* web_contents); | 112 bool AcceptWebApp(content::WebContents* web_contents); |
| 110 | 113 |
| 111 // When user accepts to install a WebAPK, this function sends a request | 114 // When user accepts to install a WebAPK, this function sends a request |
| 112 // to the WebAPK Server to create a WebAPK and install it. It returns | 115 // to the WebAPK Server to create a WebAPK and install it. It returns |
| 113 // false to prevent infobar from disappearing when installation starts. | 116 // false to prevent infobar from disappearing when installation starts. |
| 114 // When user clicks the Open button after the intallation is compelete, this | 117 // When user clicks the Open button after the intallation is compelete, this |
| 115 // function launches the installed WebAPK and returns true. | 118 // function launches the installed WebAPK and returns true. |
| 116 bool AcceptWebApk(content::WebContents* web_contents); | 119 bool AcceptWebApk(content::WebContents* web_contents); |
| 117 | 120 |
| 118 void SendBannerAccepted(content::WebContents* web_contents, | 121 void SendBannerAccepted(); |
| 119 const std::string& platform); | |
| 120 void OnWebApkInstallFinished(bool success, const std::string& webapk_package); | 122 void OnWebApkInstallFinished(bool success, const std::string& webapk_package); |
| 121 void TrackWebApkInstallationDismissEvents(InstallState install_state); | 123 void TrackWebApkInstallationDismissEvents(InstallState install_state); |
| 122 | 124 |
| 123 // ConfirmInfoBarDelegate: | 125 // ConfirmInfoBarDelegate: |
| 124 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | 126 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| 125 gfx::Image GetIcon() const override; | 127 gfx::Image GetIcon() const override; |
| 126 void InfoBarDismissed() override; | 128 void InfoBarDismissed() override; |
| 127 base::string16 GetMessageText() const override; | 129 base::string16 GetMessageText() const override; |
| 128 int GetButtons() const override; | 130 int GetButtons() const override; |
| 129 bool LinkClicked(WindowOpenDisposition disposition) override; | 131 bool LinkClicked(WindowOpenDisposition disposition) override; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 159 | 161 |
| 160 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); | 162 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); |
| 161 }; | 163 }; |
| 162 | 164 |
| 163 // Register native methods. | 165 // Register native methods. |
| 164 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); | 166 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); |
| 165 | 167 |
| 166 } // namespace banners | 168 } // namespace banners |
| 167 | 169 |
| 168 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ | 170 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| OLD | NEW |