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_UI_CONFIRM_BUBBLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_CONFIRM_BUBBLE_MODEL_H_ |
6 #define CHROME_BROWSER_UI_CONFIRM_BUBBLE_MODEL_H_ | 6 #define CHROME_BROWSER_UI_CONFIRM_BUBBLE_MODEL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "url/gurl.h" |
10 | 11 |
11 namespace gfx { | 12 namespace gfx { |
12 class Image; | 13 class Image; |
13 } | 14 } |
14 | 15 |
15 // An interface implemented by objects wishing to control an ConfirmBubbleView. | 16 // An interface implemented by objects wishing to control an ConfirmBubbleView. |
16 // To use this class to implement a bubble menu, we need two steps: | 17 // To use this class to implement a bubble menu, we need two steps: |
17 // 1. Implement a class derived from this class. | 18 // 1. Implement a class derived from this class. |
18 // 2. Call chrome::ShowConfirmBubble() with the class implemented in 1. | 19 // 2. Call chrome::ShowConfirmBubble() with the class implemented in 1. |
19 class ConfirmBubbleModel { | 20 class ConfirmBubbleModel { |
(...skipping 22 matching lines...) Expand all Loading... |
42 // returns "OK" for the OK button and "Cancel" for the Cancel button. | 43 // returns "OK" for the OK button and "Cancel" for the Cancel button. |
43 virtual base::string16 GetButtonLabel(BubbleButton button) const; | 44 virtual base::string16 GetButtonLabel(BubbleButton button) const; |
44 | 45 |
45 // Called when the OK button is pressed. | 46 // Called when the OK button is pressed. |
46 virtual void Accept(); | 47 virtual void Accept(); |
47 | 48 |
48 // Called when the Cancel button is pressed. | 49 // Called when the Cancel button is pressed. |
49 virtual void Cancel(); | 50 virtual void Cancel(); |
50 | 51 |
51 // Returns the text of the link to be displayed, if any. Otherwise returns | 52 // Returns the text of the link to be displayed, if any. Otherwise returns |
52 // and empty string. | 53 // an empty string. |
53 virtual base::string16 GetLinkText() const; | 54 virtual base::string16 GetLinkText() const; |
54 | 55 |
55 // Called when the Link is clicked. | 56 // Returns the URL of the link to be displayed. |
| 57 virtual GURL GetLinkURL() const; |
| 58 |
| 59 // Called when the link is clicked. |
56 virtual void LinkClicked(); | 60 virtual void LinkClicked(); |
57 | 61 |
58 private: | 62 private: |
59 DISALLOW_COPY_AND_ASSIGN(ConfirmBubbleModel); | 63 DISALLOW_COPY_AND_ASSIGN(ConfirmBubbleModel); |
60 }; | 64 }; |
61 | 65 |
62 #endif // CHROME_BROWSER_UI_CONFIRM_BUBBLE_MODEL_H_ | 66 #endif // CHROME_BROWSER_UI_CONFIRM_BUBBLE_MODEL_H_ |
OLD | NEW |