| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_INFOBARS_CONFIRM_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_INFOBARS_CONFIRM_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_INFOBARS_CONFIRM_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_INFOBARS_CONFIRM_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "chrome/browser/infobars/infobar_delegate.h" | 10 #include "components/infobars/core/infobar_delegate.h" |
| 11 | 11 |
| 12 namespace infobars { |
| 12 class InfoBar; | 13 class InfoBar; |
| 14 } |
| 13 | 15 |
| 14 // An interface derived from InfoBarDelegate implemented by objects wishing to | 16 // An interface derived from InfoBarDelegate implemented by objects wishing to |
| 15 // control a ConfirmInfoBar. | 17 // control a ConfirmInfoBar. |
| 16 class ConfirmInfoBarDelegate : public InfoBarDelegate { | 18 class ConfirmInfoBarDelegate : public infobars::InfoBarDelegate { |
| 17 public: | 19 public: |
| 18 enum InfoBarButton { | 20 enum InfoBarButton { |
| 19 BUTTON_NONE = 0, | 21 BUTTON_NONE = 0, |
| 20 BUTTON_OK = 1 << 0, | 22 BUTTON_OK = 1 << 0, |
| 21 BUTTON_CANCEL = 1 << 1, | 23 BUTTON_CANCEL = 1 << 1, |
| 22 }; | 24 }; |
| 23 | 25 |
| 24 virtual ~ConfirmInfoBarDelegate(); | 26 virtual ~ConfirmInfoBarDelegate(); |
| 25 | 27 |
| 26 // Returns the InfoBar type to be displayed for the InfoBar. | 28 // Returns the InfoBar type to be displayed for the InfoBar. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 57 // the resulting document should be loaded (based on the event flags present | 59 // the resulting document should be loaded (based on the event flags present |
| 58 // when the link was clicked). If this function returns true, the infobar is | 60 // when the link was clicked). If this function returns true, the infobar is |
| 59 // then immediately closed. Subclasses MUST NOT return true if in handling | 61 // then immediately closed. Subclasses MUST NOT return true if in handling |
| 60 // this call something triggers the infobar to begin closing. | 62 // this call something triggers the infobar to begin closing. |
| 61 virtual bool LinkClicked(WindowOpenDisposition disposition); | 63 virtual bool LinkClicked(WindowOpenDisposition disposition); |
| 62 | 64 |
| 63 protected: | 65 protected: |
| 64 ConfirmInfoBarDelegate(); | 66 ConfirmInfoBarDelegate(); |
| 65 | 67 |
| 66 // Returns a confirm infobar that owns |delegate|. | 68 // Returns a confirm infobar that owns |delegate|. |
| 67 static scoped_ptr<InfoBar> CreateInfoBar( | 69 static scoped_ptr<infobars::InfoBar> CreateInfoBar( |
| 68 scoped_ptr<ConfirmInfoBarDelegate> delegate); | 70 scoped_ptr<ConfirmInfoBarDelegate> delegate); |
| 69 | 71 |
| 70 virtual bool ShouldExpireInternal( | 72 virtual bool ShouldExpireInternal( |
| 71 const NavigationDetails& details) const OVERRIDE; | 73 const NavigationDetails& details) const OVERRIDE; |
| 72 | 74 |
| 73 private: | 75 private: |
| 74 // InfoBarDelegate: | 76 // InfoBarDelegate: |
| 75 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE; | 77 virtual bool EqualsDelegate( |
| 78 infobars::InfoBarDelegate* delegate) const OVERRIDE; |
| 76 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() OVERRIDE; | 79 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() OVERRIDE; |
| 77 | 80 |
| 78 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate); | 81 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate); |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 #endif // CHROME_BROWSER_INFOBARS_CONFIRM_INFOBAR_DELEGATE_H_ | 84 #endif // CHROME_BROWSER_INFOBARS_CONFIRM_INFOBAR_DELEGATE_H_ |
| OLD | NEW |