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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 | 11 |
12 class Browser; | 12 class Browser; |
13 class GlobalErrorBubbleViewBase; | 13 class GlobalErrorBubbleViewBase; |
14 | 14 |
15 // This object describes a single global error. | 15 // This object describes a single global error. |
16 class GlobalError : public base::SupportsWeakPtr<GlobalError> { | 16 class GlobalError : public base::SupportsWeakPtr<GlobalError> { |
17 public: | 17 public: |
| 18 enum Severity { |
| 19 SEVERITY_LOW, |
| 20 SEVERITY_MEDIUM, |
| 21 SEVERITY_HIGH, |
| 22 SEVERITY_CRITICAL, |
| 23 }; |
| 24 |
18 GlobalError(); | 25 GlobalError(); |
19 virtual ~GlobalError(); | 26 virtual ~GlobalError(); |
20 | 27 |
21 // Returns true if a badge should be drawn on the wrench menu button. | 28 // Returns true if a badge should be drawn on the wrench menu button. |
22 virtual bool HasBadge() = 0; | 29 virtual bool HasBadge() = 0; |
23 // Returns the resource ID of the badge icon. | 30 // Returns the resource ID of the badge icon. |
24 virtual int GetBadgeResourceID(); | 31 virtual int GetBadgeResourceID(); |
| 32 // Returns the error's severity level. If there are multiple errors, |
| 33 // the error with the highest severity will display in the menu. If not |
| 34 // overridden, this is based on the badge resource ID. |
| 35 virtual Severity GetSeverity(); |
25 | 36 |
26 // Returns true if a menu item should be added to the wrench menu. | 37 // Returns true if a menu item should be added to the wrench menu. |
27 virtual bool HasMenuItem() = 0; | 38 virtual bool HasMenuItem() = 0; |
28 // Returns the command ID for the menu item. | 39 // Returns the command ID for the menu item. |
29 virtual int MenuItemCommandID() = 0; | 40 virtual int MenuItemCommandID() = 0; |
30 // Returns the label for the menu item. | 41 // Returns the label for the menu item. |
31 virtual string16 MenuItemLabel() = 0; | 42 virtual string16 MenuItemLabel() = 0; |
32 // Returns the resource ID for the menu item icon. | 43 // Returns the resource ID for the menu item icon. |
33 virtual int MenuItemIconResourceID(); | 44 virtual int MenuItemIconResourceID(); |
34 // Called when the user clicks on the menu item. | 45 // Called when the user clicks on the menu item. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 79 |
69 | 80 |
70 private: | 81 private: |
71 bool has_shown_bubble_view_; | 82 bool has_shown_bubble_view_; |
72 GlobalErrorBubbleViewBase* bubble_view_; | 83 GlobalErrorBubbleViewBase* bubble_view_; |
73 | 84 |
74 DISALLOW_COPY_AND_ASSIGN(GlobalError); | 85 DISALLOW_COPY_AND_ASSIGN(GlobalError); |
75 }; | 86 }; |
76 | 87 |
77 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ | 88 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ |
OLD | NEW |