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 COMPONENTS_INFOBARS_CORE_CONFIRM_INFOBAR_DELEGATE_H_ | 5 #ifndef COMPONENTS_INFOBARS_CORE_CONFIRM_INFOBAR_DELEGATE_H_ |
6 #define COMPONENTS_INFOBARS_CORE_CONFIRM_INFOBAR_DELEGATE_H_ | 6 #define COMPONENTS_INFOBARS_CORE_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 "components/infobars/core/infobar_delegate.h" | 10 #include "components/infobars/core/infobar_delegate.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // and empty string. | 56 // and empty string. |
57 virtual base::string16 GetLinkText() const; | 57 virtual base::string16 GetLinkText() const; |
58 | 58 |
59 // Called when the Link (if any) is clicked. The |disposition| specifies how | 59 // Called when the Link (if any) is clicked. The |disposition| specifies how |
60 // the resulting document should be loaded (based on the event flags present | 60 // the resulting document should be loaded (based on the event flags present |
61 // when the link was clicked). If this function returns true, the infobar is | 61 // when the link was clicked). If this function returns true, the infobar is |
62 // then immediately closed. Subclasses MUST NOT return true if in handling | 62 // then immediately closed. Subclasses MUST NOT return true if in handling |
63 // this call something triggers the infobar to begin closing. | 63 // this call something triggers the infobar to begin closing. |
64 virtual bool LinkClicked(WindowOpenDisposition disposition); | 64 virtual bool LinkClicked(WindowOpenDisposition disposition); |
65 | 65 |
66 protected: | |
67 ConfirmInfoBarDelegate(); | |
68 | |
69 // Returns a confirm infobar that owns |delegate|. | 66 // Returns a confirm infobar that owns |delegate|. |
70 static scoped_ptr<infobars::InfoBar> CreateInfoBar( | 67 static scoped_ptr<infobars::InfoBar> CreateInfoBar( |
71 scoped_ptr<ConfirmInfoBarDelegate> delegate); | 68 scoped_ptr<ConfirmInfoBarDelegate> delegate); |
72 | 69 |
| 70 protected: |
| 71 ConfirmInfoBarDelegate(); |
| 72 |
73 bool ShouldExpireInternal(const NavigationDetails& details) const override; | 73 bool ShouldExpireInternal(const NavigationDetails& details) const override; |
74 | 74 |
75 private: | 75 private: |
76 // InfoBarDelegate: | 76 // InfoBarDelegate: |
77 bool EqualsDelegate(infobars::InfoBarDelegate* delegate) const override; | 77 bool EqualsDelegate(infobars::InfoBarDelegate* delegate) const override; |
78 ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() override; | 78 ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() override; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate); | 80 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate); |
81 }; | 81 }; |
82 | 82 |
83 #endif // COMPONENTS_INFOBARS_CORE_CONFIRM_INFOBAR_DELEGATE_H_ | 83 #endif // COMPONENTS_INFOBARS_CORE_CONFIRM_INFOBAR_DELEGATE_H_ |
OLD | NEW |