Chromium Code Reviews| 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> | |
| 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 27 matching lines...) Expand all Loading... | |
| 45 // Returns true if the bubble view has been shown. | 47 // Returns true if the bubble view has been shown. |
| 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 messages for the bubble view, one per line. Multiple messages |
| 56 virtual string16 GetBubbleViewMessage() = 0; | 58 // are only supported on Views. |
| 59 // TODO(yoz): Add multi-line support for GTK and Cocoa. | |
|
sail
2013/04/16 00:52:26
don't need this TODO since they're already present
Yoyo Zhou
2013/04/16 07:05:34
I figure it can't hurt to have it here too.
sail
2013/04/16 16:27:32
Sounds good.
| |
| 60 virtual std::vector<string16> GetBubbleViewMessages() = 0; | |
| 57 // Returns the accept button label for the bubble view. | 61 // Returns the accept button label for the bubble view. |
| 58 virtual string16 GetBubbleViewAcceptButtonLabel() = 0; | 62 virtual string16 GetBubbleViewAcceptButtonLabel() = 0; |
| 59 // Returns the cancel button label for the bubble view. To hide the cancel | 63 // Returns the cancel button label for the bubble view. To hide the cancel |
| 60 // button return an empty string. | 64 // button return an empty string. |
| 61 virtual string16 GetBubbleViewCancelButtonLabel() = 0; | 65 virtual string16 GetBubbleViewCancelButtonLabel() = 0; |
| 62 // Called when the bubble view is closed. |browser| is the Browser that the | 66 // Called when the bubble view is closed. |browser| is the Browser that the |
| 63 // bubble view was shown on. | 67 // bubble view was shown on. |
| 64 void BubbleViewDidClose(Browser* browser); | 68 void BubbleViewDidClose(Browser* browser); |
| 65 // Notifies subclasses that the bubble view is closed. |browser| is the | 69 // Notifies subclasses that the bubble view is closed. |browser| is the |
| 66 // Browser that the bubble view was shown on. | 70 // Browser that the bubble view was shown on. |
| 67 virtual void OnBubbleViewDidClose(Browser* browser) = 0; | 71 virtual void OnBubbleViewDidClose(Browser* browser) = 0; |
| 68 // Called when the user clicks on the accept button. |browser| is the | 72 // Called when the user clicks on the accept button. |browser| is the |
| 69 // Browser that the bubble view was shown on. | 73 // Browser that the bubble view was shown on. |
| 70 virtual void BubbleViewAcceptButtonPressed(Browser* browser) = 0; | 74 virtual void BubbleViewAcceptButtonPressed(Browser* browser) = 0; |
| 71 // Called when the user clicks the cancel button. |browser| is the | 75 // Called when the user clicks the cancel button. |browser| is the |
| 72 // Browser that the bubble view was shown on. | 76 // Browser that the bubble view was shown on. |
| 73 virtual void BubbleViewCancelButtonPressed(Browser* browser) = 0; | 77 virtual void BubbleViewCancelButtonPressed(Browser* browser) = 0; |
| 74 | 78 |
| 75 | 79 |
| 76 private: | 80 private: |
| 77 bool has_shown_bubble_view_; | 81 bool has_shown_bubble_view_; |
| 78 GlobalErrorBubbleViewBase* bubble_view_; | 82 GlobalErrorBubbleViewBase* bubble_view_; |
| 79 | 83 |
| 80 DISALLOW_COPY_AND_ASSIGN(GlobalError); | 84 DISALLOW_COPY_AND_ASSIGN(GlobalError); |
| 81 }; | 85 }; |
| 82 | 86 |
| 83 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ | 87 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ |
| OLD | NEW |