| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_GLOBAL_ERROR_H_ | |
| 6 #define CHROME_BROWSER_UI_GLOBAL_ERROR_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/memory/weak_ptr.h" | |
| 11 #include "base/string16.h" | |
| 12 | |
| 13 class Browser; | |
| 14 class GlobalErrorBubbleViewBase; | |
| 15 | |
| 16 // This object describes a single global error. | |
| 17 class GlobalError : public base::SupportsWeakPtr<GlobalError> { | |
| 18 public: | |
| 19 GlobalError(); | |
| 20 virtual ~GlobalError(); | |
| 21 | |
| 22 // Returns true if a badge should be drawn on the wrench menu button. | |
| 23 virtual bool HasBadge() = 0; | |
| 24 // Returns the resource ID of the badge icon. | |
| 25 virtual int GetBadgeResourceID(); | |
| 26 | |
| 27 // Returns true if a menu item should be added to the wrench menu. | |
| 28 virtual bool HasMenuItem() = 0; | |
| 29 // Returns the command ID for the menu item. | |
| 30 virtual int MenuItemCommandID() = 0; | |
| 31 // Returns the label for the menu item. | |
| 32 virtual string16 MenuItemLabel() = 0; | |
| 33 // Returns the resource ID for the menu item icon. | |
| 34 virtual int MenuItemIconResourceID(); | |
| 35 // Called when the user clicks on the menu item. | |
| 36 virtual void ExecuteMenuItem(Browser* browser) = 0; | |
| 37 | |
| 38 // Returns true if a bubble view should be shown. | |
| 39 virtual bool HasBubbleView() = 0; | |
| 40 // Returns true if the bubble view has been shown. | |
| 41 virtual bool HasShownBubbleView(); | |
| 42 // Called to show the bubble view. | |
| 43 void ShowBubbleView(Browser* browser); | |
| 44 // Returns the bubble view. | |
| 45 virtual GlobalErrorBubbleViewBase* GetBubbleView(); | |
| 46 // Returns the resource ID for bubble view icon. | |
| 47 virtual int GetBubbleViewIconResourceID(); | |
| 48 // Returns the title for the bubble view. | |
| 49 virtual string16 GetBubbleViewTitle() = 0; | |
| 50 // Returns the message for the bubble view. | |
| 51 virtual string16 GetBubbleViewMessage() = 0; | |
| 52 // Returns the accept button label for the bubble view. | |
| 53 virtual string16 GetBubbleViewAcceptButtonLabel() = 0; | |
| 54 // Returns the cancel button label for the bubble view. To hide the cancel | |
| 55 // button return an empty string. | |
| 56 virtual string16 GetBubbleViewCancelButtonLabel() = 0; | |
| 57 // Called when the bubble view is closed. |browser| is the Browser that the | |
| 58 // bubble view was shown on. | |
| 59 void BubbleViewDidClose(Browser* browser); | |
| 60 // Notifies subclasses that the bubble view is closed. |browser| is the | |
| 61 // Browser that the bubble view was shown on. | |
| 62 virtual void OnBubbleViewDidClose(Browser* browser) = 0; | |
| 63 // Called when the user clicks on the accept button. |browser| is the | |
| 64 // Browser that the bubble view was shown on. | |
| 65 virtual void BubbleViewAcceptButtonPressed(Browser* browser) = 0; | |
| 66 // Called when the user clicks the cancel button. |browser| is the | |
| 67 // Browser that the bubble view was shown on. | |
| 68 virtual void BubbleViewCancelButtonPressed(Browser* browser) = 0; | |
| 69 | |
| 70 | |
| 71 private: | |
| 72 bool has_shown_bubble_view_; | |
| 73 GlobalErrorBubbleViewBase* bubble_view_; | |
| 74 | |
| 75 DISALLOW_COPY_AND_ASSIGN(GlobalError); | |
| 76 }; | |
| 77 | |
| 78 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_H_ | |
| OLD | NEW |