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

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

Issue 14262009: Add support for multi-line GlobalError messages to Views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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>
9
8 #include "base/basictypes.h" 10 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
10 #include "base/string16.h" 12 #include "base/string16.h"
11 13
12 class Browser; 14 class Browser;
13 class GlobalErrorBubbleViewBase; 15 class GlobalErrorBubbleViewBase;
14 16
15 // This object describes a single global error. 17 // This object describes a single global error.
16 class GlobalError : public base::SupportsWeakPtr<GlobalError> { 18 class GlobalError : public base::SupportsWeakPtr<GlobalError> {
17 public: 19 public:
(...skipping 28 matching lines...) Expand all
46 virtual bool HasShownBubbleView(); 48 virtual bool HasShownBubbleView();
47 // Called to show the bubble view. 49 // Called to show the bubble view.
48 void ShowBubbleView(Browser* browser); 50 void ShowBubbleView(Browser* browser);
49 // Returns the bubble view. 51 // Returns the bubble view.
50 virtual GlobalErrorBubbleViewBase* GetBubbleView(); 52 virtual GlobalErrorBubbleViewBase* GetBubbleView();
51 // Returns the resource ID for bubble view icon. 53 // Returns the resource ID for bubble view icon.
52 virtual int GetBubbleViewIconResourceID(); 54 virtual int GetBubbleViewIconResourceID();
53 // Returns the title for the bubble view. 55 // Returns the title for the bubble view.
54 virtual string16 GetBubbleViewTitle() = 0; 56 virtual string16 GetBubbleViewTitle() = 0;
55 // Returns the message for the bubble view. 57 // Returns the message for the bubble view.
56 virtual string16 GetBubbleViewMessage() = 0; 58 virtual string16 GetBubbleViewMessage() = 0;
sail 2013/04/15 18:19:38 Could you remove this.
Yoyo Zhou 2013/04/15 18:43:28 Yes, although I would then have to rewrite Cocoa a
sail 2013/04/15 19:04:41 You can just grab the first message from the vecto
59 // Returns the messages for the bubble view. If present, takes precedence
60 // over GetBubbleViewMessage. Only supported on Views.
61 // TODO(yoz): Add support for GTK and Cocoa.
62 virtual std::vector<string16> GetBubbleViewMessages() = 0;
57 // Returns the accept button label for the bubble view. 63 // Returns the accept button label for the bubble view.
58 virtual string16 GetBubbleViewAcceptButtonLabel() = 0; 64 virtual string16 GetBubbleViewAcceptButtonLabel() = 0;
59 // Returns the cancel button label for the bubble view. To hide the cancel 65 // Returns the cancel button label for the bubble view. To hide the cancel
60 // button return an empty string. 66 // button return an empty string.
61 virtual string16 GetBubbleViewCancelButtonLabel() = 0; 67 virtual string16 GetBubbleViewCancelButtonLabel() = 0;
62 // Called when the bubble view is closed. |browser| is the Browser that the 68 // Called when the bubble view is closed. |browser| is the Browser that the
63 // bubble view was shown on. 69 // bubble view was shown on.
64 void BubbleViewDidClose(Browser* browser); 70 void BubbleViewDidClose(Browser* browser);
65 // Notifies subclasses that the bubble view is closed. |browser| is the 71 // Notifies subclasses that the bubble view is closed. |browser| is the
66 // Browser that the bubble view was shown on. 72 // Browser that the bubble view was shown on.
67 virtual void OnBubbleViewDidClose(Browser* browser) = 0; 73 virtual void OnBubbleViewDidClose(Browser* browser) = 0;
68 // Called when the user clicks on the accept button. |browser| is the 74 // Called when the user clicks on the accept button. |browser| is the
69 // Browser that the bubble view was shown on. 75 // Browser that the bubble view was shown on.
70 virtual void BubbleViewAcceptButtonPressed(Browser* browser) = 0; 76 virtual void BubbleViewAcceptButtonPressed(Browser* browser) = 0;
71 // Called when the user clicks the cancel button. |browser| is the 77 // Called when the user clicks the cancel button. |browser| is the
72 // Browser that the bubble view was shown on. 78 // Browser that the bubble view was shown on.
73 virtual void BubbleViewCancelButtonPressed(Browser* browser) = 0; 79 virtual void BubbleViewCancelButtonPressed(Browser* browser) = 0;
74 80
75 81
76 private: 82 private:
77 bool has_shown_bubble_view_; 83 bool has_shown_bubble_view_;
78 GlobalErrorBubbleViewBase* bubble_view_; 84 GlobalErrorBubbleViewBase* bubble_view_;
79 85
80 DISALLOW_COPY_AND_ASSIGN(GlobalError); 86 DISALLOW_COPY_AND_ASSIGN(GlobalError);
81 }; 87 };
82 88
83 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ 89 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_global_error.cc ('k') | chrome/browser/ui/global_error/global_error_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698