Index: chrome/browser/android/banners/app_banner_infobar_delegate.h |
diff --git a/chrome/browser/android/banners/app_banner_infobar_delegate.h b/chrome/browser/android/banners/app_banner_infobar_delegate.h |
index 01fddc6e832d1f4bc8902c744febdf2b52d3b15e..5bc2e0a8ec9ccc43bb8a0ebbc69e9d39a58d8158 100644 |
--- a/chrome/browser/android/banners/app_banner_infobar_delegate.h |
+++ b/chrome/browser/android/banners/app_banner_infobar_delegate.h |
@@ -5,6 +5,7 @@ |
#ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
#define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
+#include "base/android/scoped_java_ref.h" |
#include "base/strings/string16.h" |
#include "components/infobars/core/confirm_infobar_delegate.h" |
#include "ui/gfx/image/image.h" |
@@ -14,6 +15,8 @@ namespace infobars { |
class InfoBarManager; |
} // namespace infobars |
+class AppBannerInfoBar; |
+ |
namespace banners { |
// Displays information about an app being promoted by a webpage. |
@@ -26,26 +29,29 @@ class AppBannerInfoBarDelegate : public ConfirmInfoBarDelegate { |
// User has elected to block the banner from being displayed. |
virtual void Block() const = 0; |
- // User has requested that the app be installed. |
- virtual void Install() const = 0; |
+ // User has clicked the button. |
+ // Returns true if the infobar should be dismissed. |
+ virtual bool OnButtonClicked() const = 0; |
+ |
+ // Called when the infobar has been destroyed. |
+ virtual void OnInfoBarDestroyed() = 0; |
+ |
+ // Returns the title of the app. |
+ virtual base::string16 GetTitle() const = 0; |
- // Icon to display for the app. |
+ // Returns the icon to display for the app. |
virtual gfx::Image GetIcon() const = 0; |
}; |
- // Creates a banner for the current page. |
+ // Creates a banner for the current page that promotes a web app. |
// May return nullptr if the the infobar couldn't be created. |
- static infobars::InfoBar* CreateForWebApp( |
+ static AppBannerInfoBar* CreateForWebApp( |
infobars::InfoBarManager* infobar_manager, |
- const AppDelegate* delegate, |
- const base::string16& app_title, |
+ AppDelegate* delegate, |
const GURL& url); |
~AppBannerInfoBarDelegate() override; |
- // Changes the label of the button. |
- void SetButtonLabel(const std::string& button_text); |
- |
// InfoBarDelegate overrides. |
gfx::Image GetIcon() const override; |
void InfoBarDismissed() override; |
@@ -53,19 +59,12 @@ class AppBannerInfoBarDelegate : public ConfirmInfoBarDelegate { |
// ConfirmInfoBarDelegate overrides. |
base::string16 GetMessageText() const override; |
int GetButtons() const override; |
- base::string16 GetButtonLabel(InfoBarButton button) const override; |
bool Accept() override; |
private: |
- // Constructor for a banner for web apps. |
- AppBannerInfoBarDelegate(const AppDelegate* helper, |
- const base::string16& app_title, |
- const GURL& url); |
- |
- const AppDelegate* delegate_; |
- base::string16 app_title_; |
- GURL url_; |
- base::string16 button_text_; |
+ explicit AppBannerInfoBarDelegate(AppDelegate* delegate); |
+ |
+ AppDelegate* delegate_; |
DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegate); |
}; // AppBannerInfoBarDelegate |