OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/browser/tab_contents/infobar_delegate.h" | 9 #include "content/browser/tab_contents/infobar_delegate.h" |
10 | 10 |
11 // An interface derived from InfoBarDelegate implemented by objects wishing to | 11 // An interface derived from InfoBarDelegate implemented by objects wishing to |
12 // control a LinkInfoBar. | 12 // control a LinkInfoBar. |
13 class LinkInfoBarDelegate : public InfoBarDelegate { | 13 class LinkInfoBarDelegate : public InfoBarDelegate { |
14 public: | 14 public: |
15 // Returns the message string to be displayed in the InfoBar. |link_offset| | 15 // Returns the message string to be displayed in the InfoBar. |link_offset| |
16 // is the position where the link should be inserted. If |link_offset| is set | 16 // is the position where the link should be inserted. |
17 // to string16::npos (it is by default), the link is right aligned within | 17 virtual string16 GetMessageTextWithOffset(size_t* link_offset) const = 0; |
18 // the InfoBar rather than being embedded in the message text. | |
19 virtual string16 GetMessageTextWithOffset(size_t* link_offset) const; | |
20 | 18 |
21 // Returns the text of the link to be displayed. | 19 // Returns the text of the link to be displayed. |
22 virtual string16 GetLinkText() const = 0; | 20 virtual string16 GetLinkText() const = 0; |
23 | 21 |
24 // Called when the Link is clicked. The |disposition| specifies how the | 22 // Called when the Link is clicked. The |disposition| specifies how the |
25 // resulting document should be loaded (based on the event flags present when | 23 // resulting document should be loaded (based on the event flags present when |
26 // the link was clicked). This function returns true if the InfoBar should be | 24 // the link was clicked). This function returns true if the InfoBar should be |
27 // closed now or false if it should remain until the user explicitly closes | 25 // closed now or false if it should remain until the user explicitly closes |
28 // it. | 26 // it. |
29 virtual bool LinkClicked(WindowOpenDisposition disposition); | 27 virtual bool LinkClicked(WindowOpenDisposition disposition); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 virtual int GetButtons() const; | 115 virtual int GetButtons() const; |
118 | 116 |
119 SkBitmap* icon_; | 117 SkBitmap* icon_; |
120 string16 message_; | 118 string16 message_; |
121 bool auto_expire_; // Should it expire automatically on navigation? | 119 bool auto_expire_; // Should it expire automatically on navigation? |
122 | 120 |
123 DISALLOW_COPY_AND_ASSIGN(SimpleAlertInfoBarDelegate); | 121 DISALLOW_COPY_AND_ASSIGN(SimpleAlertInfoBarDelegate); |
124 }; | 122 }; |
125 | 123 |
126 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ | 124 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ |
OLD | NEW |