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

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: Created 7 years, 7 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();
57 // Returns a custom icon to use for the bubble view. If NULL, the
58 // bubble view uses GetBubbleViewIconResourceID instead.
59 virtual gfx::Image* GetBubbleViewCustomIcon();
53 // Returns the resource ID for bubble view icon. 60 // Returns the resource ID for bubble view icon.
54 int GetBubbleViewIconResourceID(); 61 int GetBubbleViewIconResourceID();
55 // Returns the title for the bubble view. 62 // Returns the title for the bubble view.
56 virtual string16 GetBubbleViewTitle() = 0; 63 virtual string16 GetBubbleViewTitle() = 0;
57 // Returns the messages for the bubble view, one per line. Multiple messages 64 // Returns the messages for the bubble view, one per line. Multiple messages
58 // are only supported on Views. 65 // are only supported on Views.
59 // TODO(yoz): Add multi-line support for GTK and Cocoa. 66 // TODO(yoz): Add multi-line support for GTK and Cocoa.
60 virtual std::vector<string16> GetBubbleViewMessages() = 0; 67 virtual std::vector<string16> GetBubbleViewMessages() = 0;
61 // Returns the accept button label for the bubble view. 68 // Returns the accept button label for the bubble view.
62 virtual string16 GetBubbleViewAcceptButtonLabel() = 0; 69 virtual string16 GetBubbleViewAcceptButtonLabel() = 0;
(...skipping 15 matching lines...) Expand all
78 85
79 86
80 private: 87 private:
81 bool has_shown_bubble_view_; 88 bool has_shown_bubble_view_;
82 GlobalErrorBubbleViewBase* bubble_view_; 89 GlobalErrorBubbleViewBase* bubble_view_;
83 90
84 DISALLOW_COPY_AND_ASSIGN(GlobalError); 91 DISALLOW_COPY_AND_ASSIGN(GlobalError);
85 }; 92 };
86 93
87 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ 94 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698