Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: chrome/browser/ui/global_error/global_error.h

Issue 15745022: Add custom icon support to GlobalError. Show extension icon in permissions increase bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no defaults Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 13
14 class Browser; 14 class Browser;
15 class GlobalErrorBubbleViewBase; 15 class GlobalErrorBubbleViewBase;
16 16
17 namespace gfx {
18 class Image;
19 }
20
17 // This object describes a single global error. 21 // This object describes a single global error.
18 class GlobalError : public base::SupportsWeakPtr<GlobalError> { 22 class GlobalError : public base::SupportsWeakPtr<GlobalError> {
19 public: 23 public:
20 enum Severity { 24 enum Severity {
21 SEVERITY_LOW, 25 SEVERITY_LOW,
22 SEVERITY_MEDIUM, 26 SEVERITY_MEDIUM,
23 SEVERITY_HIGH, 27 SEVERITY_HIGH,
24 }; 28 };
25 29
26 GlobalError(); 30 GlobalError();
(...skipping 16 matching lines...) Expand all
43 virtual void ExecuteMenuItem(Browser* browser) = 0; 47 virtual void ExecuteMenuItem(Browser* browser) = 0;
44 48
45 // Returns true if a bubble view should be shown. 49 // Returns true if a bubble view should be shown.
46 virtual bool HasBubbleView() = 0; 50 virtual bool HasBubbleView() = 0;
47 // Returns true if the bubble view has been shown. 51 // Returns true if the bubble view has been shown.
48 virtual bool HasShownBubbleView(); 52 virtual bool HasShownBubbleView();
49 // Called to show the bubble view. 53 // Called to show the bubble view.
50 void ShowBubbleView(Browser* browser); 54 void ShowBubbleView(Browser* browser);
51 // Returns the bubble view. 55 // Returns the bubble view.
52 virtual GlobalErrorBubbleViewBase* GetBubbleView(); 56 virtual GlobalErrorBubbleViewBase* GetBubbleView();
53 // Returns the resource ID for bubble view icon. 57 // Returns an icon to use for the bubble view.
54 int GetBubbleViewIconResourceID(); 58 virtual gfx::Image GetBubbleViewIcon() = 0;
sail 2013/05/28 22:41:22 Any reason not have a default implementation retur
Yoyo Zhou 2013/05/28 22:56:44 Nope, that's a much better plan. I was just having
55 // Returns the title for the bubble view. 59 // Returns the title for the bubble view.
56 virtual string16 GetBubbleViewTitle() = 0; 60 virtual string16 GetBubbleViewTitle() = 0;
57 // Returns the messages for the bubble view, one per line. Multiple messages 61 // Returns the messages for the bubble view, one per line. Multiple messages
58 // are only supported on Views. 62 // are only supported on Views.
59 // TODO(yoz): Add multi-line support for GTK and Cocoa. 63 // TODO(yoz): Add multi-line support for GTK and Cocoa.
60 virtual std::vector<string16> GetBubbleViewMessages() = 0; 64 virtual std::vector<string16> GetBubbleViewMessages() = 0;
61 // Returns the accept button label for the bubble view. 65 // Returns the accept button label for the bubble view.
62 virtual string16 GetBubbleViewAcceptButtonLabel() = 0; 66 virtual string16 GetBubbleViewAcceptButtonLabel() = 0;
63 // Returns the cancel button label for the bubble view. To hide the cancel 67 // Returns the cancel button label for the bubble view. To hide the cancel
64 // button return an empty string. 68 // button return an empty string.
(...skipping 13 matching lines...) Expand all
78 82
79 83
80 private: 84 private:
81 bool has_shown_bubble_view_; 85 bool has_shown_bubble_view_;
82 GlobalErrorBubbleViewBase* bubble_view_; 86 GlobalErrorBubbleViewBase* bubble_view_;
83 87
84 DISALLOW_COPY_AND_ASSIGN(GlobalError); 88 DISALLOW_COPY_AND_ASSIGN(GlobalError);
85 }; 89 };
86 90
87 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ 91 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/global_error_bubble_controller.mm ('k') | chrome/browser/ui/global_error/global_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698