| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 5 #ifndef COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
| 6 #define COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 6 #define COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "ui/base/window_open_disposition.h" | 10 #include "ui/base/window_open_disposition.h" |
| 11 | 11 |
| 12 class ConfirmInfoBarDelegate; | 12 class ConfirmInfoBarDelegate; |
| 13 class HungRendererInfoBarDelegate; | 13 class HungRendererInfoBarDelegate; |
| 14 class InsecureContentInfoBarDelegate; | 14 class InsecureContentInfoBarDelegate; |
| 15 class MediaStreamInfoBarDelegate; | |
| 16 class NativeAppInfoBarDelegate; | 15 class NativeAppInfoBarDelegate; |
| 17 class PermissionInfobarDelegate; | 16 class PermissionInfobarDelegate; |
| 18 class PopupBlockedInfoBarDelegate; | 17 class PopupBlockedInfoBarDelegate; |
| 19 class RegisterProtocolHandlerInfoBarDelegate; | 18 class RegisterProtocolHandlerInfoBarDelegate; |
| 20 class ScreenCaptureInfoBarDelegate; | 19 class ScreenCaptureInfoBarDelegate; |
| 21 class ThemeInstalledInfoBarDelegate; | 20 class ThemeInstalledInfoBarDelegate; |
| 22 class ThreeDAPIInfoBarDelegate; | 21 class ThreeDAPIInfoBarDelegate; |
| 23 | 22 |
| 24 #if defined(OS_ANDROID) | 23 #if defined(OS_ANDROID) |
| 24 class MediaStreamInfoBarDelegateAndroid; |
| 25 class MediaThrottleInfoBarDelegate; | 25 class MediaThrottleInfoBarDelegate; |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 namespace translate { | 28 namespace translate { |
| 29 class TranslateInfoBarDelegate; | 29 class TranslateInfoBarDelegate; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace gfx { | 32 namespace gfx { |
| 33 class Image; | 33 class Image; |
| 34 enum class VectorIconId; | 34 enum class VectorIconId; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // what level of control they need. | 117 // what level of control they need. |
| 118 virtual bool ShouldExpire(const NavigationDetails& details) const; | 118 virtual bool ShouldExpire(const NavigationDetails& details) const; |
| 119 | 119 |
| 120 // Called when the user clicks on the close button to dismiss the infobar. | 120 // Called when the user clicks on the close button to dismiss the infobar. |
| 121 virtual void InfoBarDismissed(); | 121 virtual void InfoBarDismissed(); |
| 122 | 122 |
| 123 // Type-checking downcast routines: | 123 // Type-checking downcast routines: |
| 124 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate(); | 124 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate(); |
| 125 virtual HungRendererInfoBarDelegate* AsHungRendererInfoBarDelegate(); | 125 virtual HungRendererInfoBarDelegate* AsHungRendererInfoBarDelegate(); |
| 126 virtual InsecureContentInfoBarDelegate* AsInsecureContentInfoBarDelegate(); | 126 virtual InsecureContentInfoBarDelegate* AsInsecureContentInfoBarDelegate(); |
| 127 virtual MediaStreamInfoBarDelegate* AsMediaStreamInfoBarDelegate(); | |
| 128 virtual NativeAppInfoBarDelegate* AsNativeAppInfoBarDelegate(); | 127 virtual NativeAppInfoBarDelegate* AsNativeAppInfoBarDelegate(); |
| 129 virtual PermissionInfobarDelegate* AsPermissionInfobarDelegate(); | 128 virtual PermissionInfobarDelegate* AsPermissionInfobarDelegate(); |
| 130 virtual PopupBlockedInfoBarDelegate* AsPopupBlockedInfoBarDelegate(); | 129 virtual PopupBlockedInfoBarDelegate* AsPopupBlockedInfoBarDelegate(); |
| 131 virtual RegisterProtocolHandlerInfoBarDelegate* | 130 virtual RegisterProtocolHandlerInfoBarDelegate* |
| 132 AsRegisterProtocolHandlerInfoBarDelegate(); | 131 AsRegisterProtocolHandlerInfoBarDelegate(); |
| 133 virtual ScreenCaptureInfoBarDelegate* AsScreenCaptureInfoBarDelegate(); | 132 virtual ScreenCaptureInfoBarDelegate* AsScreenCaptureInfoBarDelegate(); |
| 134 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); | 133 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); |
| 135 virtual ThreeDAPIInfoBarDelegate* AsThreeDAPIInfoBarDelegate(); | 134 virtual ThreeDAPIInfoBarDelegate* AsThreeDAPIInfoBarDelegate(); |
| 136 virtual translate::TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); | 135 virtual translate::TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); |
| 137 #if defined(OS_ANDROID) | 136 #if defined(OS_ANDROID) |
| 137 virtual MediaStreamInfoBarDelegateAndroid* |
| 138 AsMediaStreamInfoBarDelegateAndroid(); |
| 138 virtual MediaThrottleInfoBarDelegate* AsMediaThrottleInfoBarDelegate(); | 139 virtual MediaThrottleInfoBarDelegate* AsMediaThrottleInfoBarDelegate(); |
| 139 #endif | 140 #endif |
| 140 | 141 |
| 141 void set_infobar(InfoBar* infobar) { infobar_ = infobar; } | 142 void set_infobar(InfoBar* infobar) { infobar_ = infobar; } |
| 142 void set_nav_entry_id(int nav_entry_id) { nav_entry_id_ = nav_entry_id; } | 143 void set_nav_entry_id(int nav_entry_id) { nav_entry_id_ = nav_entry_id; } |
| 143 | 144 |
| 144 protected: | 145 protected: |
| 145 InfoBarDelegate(); | 146 InfoBarDelegate(); |
| 146 | 147 |
| 147 InfoBar* infobar() { return infobar_; } | 148 InfoBar* infobar() { return infobar_; } |
| 148 | 149 |
| 149 private: | 150 private: |
| 150 // The InfoBar associated with us. | 151 // The InfoBar associated with us. |
| 151 InfoBar* infobar_; | 152 InfoBar* infobar_; |
| 152 | 153 |
| 153 // The ID of the active navigation entry at the time we became owned. | 154 // The ID of the active navigation entry at the time we became owned. |
| 154 int nav_entry_id_; | 155 int nav_entry_id_; |
| 155 | 156 |
| 156 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 157 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
| 157 }; | 158 }; |
| 158 | 159 |
| 159 } // namespace infobars | 160 } // namespace infobars |
| 160 | 161 |
| 161 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 162 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |