Chromium Code Reviews| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "ui/base/window_open_disposition.h" | 11 #include "ui/base/window_open_disposition.h" |
| 12 | 12 |
| 13 class ConfirmInfoBarDelegate; | 13 class ConfirmInfoBarDelegate; |
| 14 class HungRendererInfoBarDelegate; | 14 class HungRendererInfoBarDelegate; |
| 15 class InsecureContentInfoBarDelegate; | 15 class InsecureContentInfoBarDelegate; |
| 16 class NativeAppInfoBarDelegate; | 16 class NativeAppInfoBarDelegate; |
| 17 class PermissionInfoBarDelegate; | 17 class PermissionInfoBarDelegate; |
| 18 class PopupBlockedInfoBarDelegate; | 18 class PopupBlockedInfoBarDelegate; |
| 19 class RegisterProtocolHandlerInfoBarDelegate; | 19 class RegisterProtocolHandlerInfoBarDelegate; |
| 20 class ScreenCaptureInfoBarDelegate; | 20 class ScreenCaptureInfoBarDelegate; |
| 21 class ThemeInstalledInfoBarDelegate; | 21 class ThemeInstalledInfoBarDelegate; |
| 22 class ThreeDAPIInfoBarDelegate; | 22 class ThreeDAPIInfoBarDelegate; |
| 23 | 23 |
| 24 #if defined(OS_ANDROID) | 24 #if defined(OS_ANDROID) |
| 25 class MediaStreamInfoBarDelegateAndroid; | 25 class MediaStreamInfoBarDelegateAndroid; |
| 26 class MediaThrottleInfoBarDelegate; | 26 class MediaThrottleInfoBarDelegate; |
| 27 class ScreenCaptureInfoBarDelegateAndroid; | |
| 27 #endif | 28 #endif |
| 28 | 29 |
| 29 namespace translate { | 30 namespace translate { |
| 30 class TranslateInfoBarDelegate; | 31 class TranslateInfoBarDelegate; |
| 31 } | 32 } |
| 32 | 33 |
| 33 namespace gfx { | 34 namespace gfx { |
| 34 class Image; | 35 class Image; |
| 35 enum class VectorIconId; | 36 enum class VectorIconId; |
| 36 } | 37 } |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 enum InfoBarAutomationType { | 57 enum InfoBarAutomationType { |
| 57 CONFIRM_INFOBAR, | 58 CONFIRM_INFOBAR, |
| 58 PASSWORD_INFOBAR, | 59 PASSWORD_INFOBAR, |
| 59 RPH_INFOBAR, | 60 RPH_INFOBAR, |
| 60 UNKNOWN_INFOBAR, | 61 UNKNOWN_INFOBAR, |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 // Unique identifier for every InfoBarDelegate subclass. | 64 // Unique identifier for every InfoBarDelegate subclass. |
| 64 // KEEP IN SYNC WITH THE InfoBarIdentifier ENUM IN histograms.xml. | 65 // KEEP IN SYNC WITH THE InfoBarIdentifier ENUM IN histograms.xml. |
|
tsergeant
2016/09/20 01:17:55
You'll need to modify this enum since you've added
braveyao
2016/09/20 21:20:42
Done.
| |
| 65 // NEW VALUES MUST BE APPENDED AND AVOID CHANGING ANY PRE-EXISTING VALUES. | 66 // NEW VALUES MUST BE APPENDED AND AVOID CHANGING ANY PRE-EXISTING VALUES. |
| 66 // A Java counterpart will be generated for this enum. | 67 // A Java counterpart will be generated for this enum. |
| 67 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.infobar | 68 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.infobar |
| 68 enum InfoBarIdentifier { | 69 enum InfoBarIdentifier { |
| 69 INVALID = -1, | 70 INVALID = -1, |
| 70 TEST_INFOBAR = 0, | 71 TEST_INFOBAR = 0, |
| 71 APP_BANNER_INFOBAR_DELEGATE_ANDROID = 1, | 72 APP_BANNER_INFOBAR_DELEGATE_ANDROID = 1, |
| 72 APP_BANNER_INFOBAR_DELEGATE_DESKTOP = 2, | 73 APP_BANNER_INFOBAR_DELEGATE_DESKTOP = 2, |
| 73 ANDROID_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE = 3, | 74 ANDROID_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE = 3, |
| 74 CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE = 4, | 75 CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE = 4, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 UPGRADE_INFOBAR_DELEGATE_IOS = 59, | 130 UPGRADE_INFOBAR_DELEGATE_IOS = 59, |
| 130 CHROME_WINDOW_ERROR = 60, | 131 CHROME_WINDOW_ERROR = 60, |
| 131 CONFIRM_DANGEROUS_DOWNLOAD = 61, | 132 CONFIRM_DANGEROUS_DOWNLOAD = 61, |
| 132 // Removed: DESKTOP_SEARCH_REDIRECTION_INFOBAR_DELEGATE = 62, | 133 // Removed: DESKTOP_SEARCH_REDIRECTION_INFOBAR_DELEGATE = 62, |
| 133 UPDATE_PASSWORD_INFOBAR_DELEGATE = 63, | 134 UPDATE_PASSWORD_INFOBAR_DELEGATE = 63, |
| 134 DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDROID = 64, | 135 DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDROID = 64, |
| 135 AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_DELEGATE_ANDROID = 65, | 136 AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_DELEGATE_ANDROID = 65, |
| 136 SUBRESOURCE_FILTER_INFOBAR_DELEGATE_ANDROID = 66, | 137 SUBRESOURCE_FILTER_INFOBAR_DELEGATE_ANDROID = 66, |
| 137 INSTANT_APPS_INFOBAR_DELEGATE_ANDROID = 67, | 138 INSTANT_APPS_INFOBAR_DELEGATE_ANDROID = 67, |
| 138 DATA_REDUCTION_PROXY_PREVIEW_INFOBAR_DELEGATE = 68, | 139 DATA_REDUCTION_PROXY_PREVIEW_INFOBAR_DELEGATE = 68, |
| 140 SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID = 69, | |
| 139 }; | 141 }; |
| 140 | 142 |
| 141 // Describes navigation events, used to decide whether infobars should be | 143 // Describes navigation events, used to decide whether infobars should be |
| 142 // dismissed. | 144 // dismissed. |
| 143 struct NavigationDetails { | 145 struct NavigationDetails { |
| 144 // Unique identifier for the entry. | 146 // Unique identifier for the entry. |
| 145 int entry_id; | 147 int entry_id; |
| 146 // True if it is a navigation to a different page (as opposed to in-page). | 148 // True if it is a navigation to a different page (as opposed to in-page). |
| 147 bool is_navigation_to_different_page; | 149 bool is_navigation_to_different_page; |
| 148 // True if the entry replaced the existing one. | 150 // True if the entry replaced the existing one. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 virtual RegisterProtocolHandlerInfoBarDelegate* | 215 virtual RegisterProtocolHandlerInfoBarDelegate* |
| 214 AsRegisterProtocolHandlerInfoBarDelegate(); | 216 AsRegisterProtocolHandlerInfoBarDelegate(); |
| 215 virtual ScreenCaptureInfoBarDelegate* AsScreenCaptureInfoBarDelegate(); | 217 virtual ScreenCaptureInfoBarDelegate* AsScreenCaptureInfoBarDelegate(); |
| 216 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); | 218 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); |
| 217 virtual ThreeDAPIInfoBarDelegate* AsThreeDAPIInfoBarDelegate(); | 219 virtual ThreeDAPIInfoBarDelegate* AsThreeDAPIInfoBarDelegate(); |
| 218 virtual translate::TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); | 220 virtual translate::TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); |
| 219 #if defined(OS_ANDROID) | 221 #if defined(OS_ANDROID) |
| 220 virtual MediaStreamInfoBarDelegateAndroid* | 222 virtual MediaStreamInfoBarDelegateAndroid* |
| 221 AsMediaStreamInfoBarDelegateAndroid(); | 223 AsMediaStreamInfoBarDelegateAndroid(); |
| 222 virtual MediaThrottleInfoBarDelegate* AsMediaThrottleInfoBarDelegate(); | 224 virtual MediaThrottleInfoBarDelegate* AsMediaThrottleInfoBarDelegate(); |
| 225 virtual ScreenCaptureInfoBarDelegateAndroid* | |
| 226 AsScreenCaptureInfoBarDelegateAndroid(); | |
| 223 #endif | 227 #endif |
| 224 | 228 |
| 225 void set_infobar(InfoBar* infobar) { infobar_ = infobar; } | 229 void set_infobar(InfoBar* infobar) { infobar_ = infobar; } |
| 226 void set_nav_entry_id(int nav_entry_id) { nav_entry_id_ = nav_entry_id; } | 230 void set_nav_entry_id(int nav_entry_id) { nav_entry_id_ = nav_entry_id; } |
| 227 | 231 |
| 228 protected: | 232 protected: |
| 229 InfoBarDelegate(); | 233 InfoBarDelegate(); |
| 230 | 234 |
| 231 InfoBar* infobar() { return infobar_; } | 235 InfoBar* infobar() { return infobar_; } |
| 232 | 236 |
| 233 private: | 237 private: |
| 234 // The InfoBar associated with us. | 238 // The InfoBar associated with us. |
| 235 InfoBar* infobar_; | 239 InfoBar* infobar_; |
| 236 | 240 |
| 237 // The ID of the active navigation entry at the time we became owned. | 241 // The ID of the active navigation entry at the time we became owned. |
| 238 int nav_entry_id_; | 242 int nav_entry_id_; |
| 239 | 243 |
| 240 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 244 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
| 241 }; | 245 }; |
| 242 | 246 |
| 243 } // namespace infobars | 247 } // namespace infobars |
| 244 | 248 |
| 245 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 249 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |