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_GLOBAL_ERROR_GLOBAL_ERROR_H_ | 5 #ifndef CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ |
6 #define CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ | 6 #define CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 }; | 57 }; |
58 | 58 |
59 // This object describes a single global error that already comes with support | 59 // This object describes a single global error that already comes with support |
60 // for showing a standard Bubble UI. Derived classes just need to supply the | 60 // for showing a standard Bubble UI. Derived classes just need to supply the |
61 // content to be displayed in the bubble. | 61 // content to be displayed in the bubble. |
62 class GlobalErrorWithStandardBubble | 62 class GlobalErrorWithStandardBubble |
63 : public GlobalError, | 63 : public GlobalError, |
64 public base::SupportsWeakPtr<GlobalErrorWithStandardBubble> { | 64 public base::SupportsWeakPtr<GlobalErrorWithStandardBubble> { |
65 public: | 65 public: |
66 GlobalErrorWithStandardBubble(); | 66 GlobalErrorWithStandardBubble(); |
67 virtual ~GlobalErrorWithStandardBubble(); | 67 ~GlobalErrorWithStandardBubble() override; |
68 | 68 |
69 // Returns an icon to use for the bubble view. | 69 // Returns an icon to use for the bubble view. |
70 virtual gfx::Image GetBubbleViewIcon(); | 70 virtual gfx::Image GetBubbleViewIcon(); |
71 | 71 |
72 // Returns the title for the bubble view. | 72 // Returns the title for the bubble view. |
73 virtual base::string16 GetBubbleViewTitle() = 0; | 73 virtual base::string16 GetBubbleViewTitle() = 0; |
74 // Returns the messages for the bubble view, one per line. Multiple messages | 74 // Returns the messages for the bubble view, one per line. Multiple messages |
75 // are only supported on Views. | 75 // are only supported on Views. |
76 // TODO(yoz): Add multi-line support for GTK and Cocoa. | 76 // TODO(yoz): Add multi-line support for GTK and Cocoa. |
77 virtual std::vector<base::string16> GetBubbleViewMessages() = 0; | 77 virtual std::vector<base::string16> GetBubbleViewMessages() = 0; |
(...skipping 13 matching lines...) Expand all Loading... |
91 virtual void BubbleViewAcceptButtonPressed(Browser* browser) = 0; | 91 virtual void BubbleViewAcceptButtonPressed(Browser* browser) = 0; |
92 // Called when the user clicks the cancel button. |browser| is the | 92 // Called when the user clicks the cancel button. |browser| is the |
93 // Browser that the bubble view was shown on. | 93 // Browser that the bubble view was shown on. |
94 virtual void BubbleViewCancelButtonPressed(Browser* browser) = 0; | 94 virtual void BubbleViewCancelButtonPressed(Browser* browser) = 0; |
95 // Returns true if the bubble should close when focus is lost. If false, the | 95 // Returns true if the bubble should close when focus is lost. If false, the |
96 // bubble will stick around until the user explicitly acknowledges it. | 96 // bubble will stick around until the user explicitly acknowledges it. |
97 // Defaults to true. | 97 // Defaults to true. |
98 virtual bool ShouldCloseOnDeactivate() const; | 98 virtual bool ShouldCloseOnDeactivate() const; |
99 | 99 |
100 // GlobalError overrides: | 100 // GlobalError overrides: |
101 virtual bool HasBubbleView() override; | 101 bool HasBubbleView() override; |
102 virtual bool HasShownBubbleView() override; | 102 bool HasShownBubbleView() override; |
103 virtual void ShowBubbleView(Browser* browser) override; | 103 void ShowBubbleView(Browser* browser) override; |
104 virtual GlobalErrorBubbleViewBase* GetBubbleView() override; | 104 GlobalErrorBubbleViewBase* GetBubbleView() override; |
105 | 105 |
106 private: | 106 private: |
107 bool has_shown_bubble_view_; | 107 bool has_shown_bubble_view_; |
108 GlobalErrorBubbleViewBase* bubble_view_; | 108 GlobalErrorBubbleViewBase* bubble_view_; |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(GlobalErrorWithStandardBubble); | 110 DISALLOW_COPY_AND_ASSIGN(GlobalErrorWithStandardBubble); |
111 }; | 111 }; |
112 | 112 |
113 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ | 113 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ |
OLD | NEW |