| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_TAB_CONTENTS_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "app/resource_bundle.h" |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "chrome/browser/tab_contents/navigation_controller.h" | 12 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 12 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
| 13 #include "webkit/glue/window_open_disposition.h" | 14 #include "webkit/glue/window_open_disposition.h" |
| 15 #include "grit/theme_resources.h" |
| 14 | 16 |
| 15 class AlertInfoBarDelegate; | 17 class AlertInfoBarDelegate; |
| 16 class ConfirmInfoBarDelegate; | 18 class ConfirmInfoBarDelegate; |
| 17 class InfoBar; | 19 class InfoBar; |
| 20 struct InfoBarStyle; |
| 21 class CustomizeGeolocInfoBarDelegate; |
| 22 class GeolocInfoBarDelegate; |
| 18 class LinkInfoBarDelegate; | 23 class LinkInfoBarDelegate; |
| 19 class ThemePreviewInfobarDelegate; | 24 class ThemePreviewInfobarDelegate; |
| 20 | 25 |
| 21 // An interface implemented by objects wishing to control an InfoBar. | 26 // An interface implemented by objects wishing to control an InfoBar. |
| 22 // Implementing this interface is not sufficient to use an InfoBar, since it | 27 // Implementing this interface is not sufficient to use an InfoBar, since it |
| 23 // does not map to a specific InfoBar type. Instead, you must implement either | 28 // does not map to a specific InfoBar type. Instead, you must implement either |
| 24 // AlertInfoBarDelegate or ConfirmInfoBarDelegate, or override with your own | 29 // AlertInfoBarDelegate or ConfirmInfoBarDelegate, or override with your own |
| 25 // delegate for your own InfoBar variety. | 30 // delegate for your own InfoBar variety. |
| 26 // | 31 // |
| 27 // --- WARNING --- | 32 // --- WARNING --- |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 virtual void InfoBarClosed() {} | 79 virtual void InfoBarClosed() {} |
| 75 | 80 |
| 76 // Called to create the InfoBar. Implementation of this method is | 81 // Called to create the InfoBar. Implementation of this method is |
| 77 // platform-specific. | 82 // platform-specific. |
| 78 virtual InfoBar* CreateInfoBar() = 0; | 83 virtual InfoBar* CreateInfoBar() = 0; |
| 79 | 84 |
| 80 // Return the icon to be shown for this InfoBar. If the returned bitmap is | 85 // Return the icon to be shown for this InfoBar. If the returned bitmap is |
| 81 // NULL, no icon is shown. | 86 // NULL, no icon is shown. |
| 82 virtual SkBitmap* GetIcon() const { return NULL; } | 87 virtual SkBitmap* GetIcon() const { return NULL; } |
| 83 | 88 |
| 89 // Returns the desired styling attributes for this infobar. |
| 90 virtual InfoBarStyle* GetStyle() const { return NULL; } |
| 91 |
| 84 // Returns a pointer to the AlertInfoBarDelegate interface, if implemented. | 92 // Returns a pointer to the AlertInfoBarDelegate interface, if implemented. |
| 85 virtual AlertInfoBarDelegate* AsAlertInfoBarDelegate() { | 93 virtual AlertInfoBarDelegate* AsAlertInfoBarDelegate() { |
| 86 return NULL; | 94 return NULL; |
| 87 } | 95 } |
| 88 | 96 |
| 89 // Returns a pointer to the LinkInfoBarDelegate interface, if implemented. | 97 // Returns a pointer to the LinkInfoBarDelegate interface, if implemented. |
| 90 virtual LinkInfoBarDelegate* AsLinkInfoBarDelegate() { | 98 virtual LinkInfoBarDelegate* AsLinkInfoBarDelegate() { |
| 91 return NULL; | 99 return NULL; |
| 92 } | 100 } |
| 93 | 101 |
| 94 // Returns a pointer to the ConfirmInfoBarDelegate interface, if implemented. | 102 // Returns a pointer to the ConfirmInfoBarDelegate interface, if implemented. |
| 95 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() { | 103 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() { |
| 96 return NULL; | 104 return NULL; |
| 97 } | 105 } |
| 98 | 106 |
| 107 // Returns a pointer to the GeolocInfoBarDelegate interface, if implemented. |
| 108 virtual GeolocInfoBarDelegate* AsGeolocInfoBarDelegate() { |
| 109 return NULL; |
| 110 } |
| 111 |
| 112 // Returns a pointer to the CustomizeGeolocInfoBarDelegate |
| 113 // interface, if implemented. |
| 114 virtual CustomizeGeolocInfoBarDelegate* AsCustomizeGeolocInfoBarDelegate() { |
| 115 return NULL; |
| 116 } |
| 117 |
| 99 // Returns a pointer to the ThemePreviewInfobarDelegate interface, if | 118 // Returns a pointer to the ThemePreviewInfobarDelegate interface, if |
| 100 // implemented. | 119 // implemented. |
| 101 virtual ThemePreviewInfobarDelegate* AsThemePreviewInfobarDelegate() { | 120 virtual ThemePreviewInfobarDelegate* AsThemePreviewInfobarDelegate() { |
| 102 return NULL; | 121 return NULL; |
| 103 } | 122 } |
| 104 | 123 |
| 105 // Returns the type of the infobar. The type determines the appearance (such | 124 // Returns the type of the infobar. The type determines the appearance (such |
| 106 // as background color) of the infobar. | 125 // as background color) of the infobar. |
| 107 virtual Type GetInfoBarType() { | 126 virtual Type GetInfoBarType() { |
| 108 return WARNING_TYPE; | 127 return WARNING_TYPE; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 virtual void InfoBarClosed(); | 264 virtual void InfoBarClosed(); |
| 246 | 265 |
| 247 private: | 266 private: |
| 248 std::wstring message_; | 267 std::wstring message_; |
| 249 SkBitmap* icon_; | 268 SkBitmap* icon_; |
| 250 | 269 |
| 251 DISALLOW_COPY_AND_ASSIGN(SimpleAlertInfoBarDelegate); | 270 DISALLOW_COPY_AND_ASSIGN(SimpleAlertInfoBarDelegate); |
| 252 }; | 271 }; |
| 253 | 272 |
| 254 #endif // #ifndef CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ | 273 #endif // #ifndef CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ |
| OLD | NEW |