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_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "components/infobars/core/confirm_infobar_delegate.h" | 10 #include "components/infobars/core/confirm_infobar_delegate.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // app. | 26 // app. |
27 class AppDelegate { | 27 class AppDelegate { |
28 public: | 28 public: |
29 // User has elected to block the banner from being displayed. | 29 // User has elected to block the banner from being displayed. |
30 virtual void Block() const = 0; | 30 virtual void Block() const = 0; |
31 | 31 |
32 // User has clicked the button. | 32 // User has clicked the button. |
33 // Returns true if the infobar should be dismissed. | 33 // Returns true if the infobar should be dismissed. |
34 virtual bool OnButtonClicked() const = 0; | 34 virtual bool OnButtonClicked() const = 0; |
35 | 35 |
| 36 // User has clicked the link. |
| 37 // Returns true if the infobar should be dismissed. |
| 38 virtual bool OnLinkClicked() const = 0; |
| 39 |
36 // Called when the infobar has been destroyed. | 40 // Called when the infobar has been destroyed. |
37 virtual void OnInfoBarDestroyed() = 0; | 41 virtual void OnInfoBarDestroyed() = 0; |
38 | 42 |
39 // Returns the title of the app. | 43 // Returns the title of the app. |
40 virtual base::string16 GetTitle() const = 0; | 44 virtual base::string16 GetTitle() const = 0; |
41 | 45 |
42 // Returns the icon to display for the app. | 46 // Returns the icon to display for the app. |
43 virtual gfx::Image GetIcon() const = 0; | 47 virtual gfx::Image GetIcon() const = 0; |
44 }; | 48 }; |
45 | 49 |
(...skipping 14 matching lines...) Expand all Loading... |
60 ~AppBannerInfoBarDelegate() override; | 64 ~AppBannerInfoBarDelegate() override; |
61 | 65 |
62 // InfoBarDelegate overrides. | 66 // InfoBarDelegate overrides. |
63 gfx::Image GetIcon() const override; | 67 gfx::Image GetIcon() const override; |
64 void InfoBarDismissed() override; | 68 void InfoBarDismissed() override; |
65 | 69 |
66 // ConfirmInfoBarDelegate overrides. | 70 // ConfirmInfoBarDelegate overrides. |
67 base::string16 GetMessageText() const override; | 71 base::string16 GetMessageText() const override; |
68 int GetButtons() const override; | 72 int GetButtons() const override; |
69 bool Accept() override; | 73 bool Accept() override; |
| 74 bool LinkClicked(WindowOpenDisposition disposition) override; |
70 | 75 |
71 private: | 76 private: |
72 explicit AppBannerInfoBarDelegate(AppDelegate* delegate); | 77 explicit AppBannerInfoBarDelegate(AppDelegate* delegate); |
73 | 78 |
74 AppDelegate* delegate_; | 79 AppDelegate* delegate_; |
75 | 80 |
76 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegate); | 81 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegate); |
77 }; // AppBannerInfoBarDelegate | 82 }; // AppBannerInfoBarDelegate |
78 | 83 |
79 } // namespace banners | 84 } // namespace banners |
80 | 85 |
81 bool RegisterAppBannerInfoBarDelegate(JNIEnv* env); | 86 bool RegisterAppBannerInfoBarDelegate(JNIEnv* env); |
82 | 87 |
83 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ | 88 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
OLD | NEW |