| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 virtual std::wstring GetButtonLabel(InfoBarButton button) const; | 234 virtual std::wstring GetButtonLabel(InfoBarButton button) const; |
| 235 | 235 |
| 236 // Called when the OK button is pressed. If the function returns true, the | 236 // Called when the OK button is pressed. If the function returns true, the |
| 237 // InfoBarDelegate should be removed from the associated TabContents. | 237 // InfoBarDelegate should be removed from the associated TabContents. |
| 238 virtual bool Accept() { return true; } | 238 virtual bool Accept() { return true; } |
| 239 | 239 |
| 240 // Called when the Cancel button is pressed. If the function returns true, | 240 // Called when the Cancel button is pressed. If the function returns true, |
| 241 // the InfoBarDelegate should be removed from the associated TabContents. | 241 // the InfoBarDelegate should be removed from the associated TabContents. |
| 242 virtual bool Cancel() { return true; } | 242 virtual bool Cancel() { return true; } |
| 243 | 243 |
| 244 // Returns the text of the link to be displayed, if any. Otherwise returns |
| 245 // and empty string. |
| 246 virtual std::wstring GetLinkText() { |
| 247 return std::wstring(); |
| 248 } |
| 249 |
| 250 // Called when the Link is clicked. The |disposition| specifies how the |
| 251 // resulting document should be loaded (based on the event flags present when |
| 252 // the link was clicked). This function returns true if the InfoBar should be |
| 253 // closed now or false if it should remain until the user explicitly closes |
| 254 // it. |
| 255 // Will only be called if GetLinkText() returns non-empty string. |
| 256 virtual bool LinkClicked(WindowOpenDisposition disposition) { |
| 257 return true; |
| 258 } |
| 259 |
| 244 // Overridden from InfoBarDelegate: | 260 // Overridden from InfoBarDelegate: |
| 245 virtual InfoBar* CreateInfoBar(); | 261 virtual InfoBar* CreateInfoBar(); |
| 246 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() { | 262 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() { |
| 247 return this; | 263 return this; |
| 248 } | 264 } |
| 249 | 265 |
| 250 protected: | 266 protected: |
| 251 explicit ConfirmInfoBarDelegate(TabContents* contents); | 267 explicit ConfirmInfoBarDelegate(TabContents* contents); |
| 252 | 268 |
| 253 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate); | 269 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 267 virtual void InfoBarClosed(); | 283 virtual void InfoBarClosed(); |
| 268 | 284 |
| 269 private: | 285 private: |
| 270 std::wstring message_; | 286 std::wstring message_; |
| 271 SkBitmap* icon_; | 287 SkBitmap* icon_; |
| 272 | 288 |
| 273 DISALLOW_COPY_AND_ASSIGN(SimpleAlertInfoBarDelegate); | 289 DISALLOW_COPY_AND_ASSIGN(SimpleAlertInfoBarDelegate); |
| 274 }; | 290 }; |
| 275 | 291 |
| 276 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ | 292 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ |
| OLD | NEW |