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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_UI_DEFAULT_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_UI_DEFAULT_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/extensions/extension_error_ui.h"
11 #include "chrome/browser/ui/global_error/global_error.h"
12 #include "chrome/common/extensions/extension.h"
15 class ExtensionService
;
17 class ExtensionErrorUIDefault
: public ExtensionErrorUI
{
19 explicit ExtensionErrorUIDefault(ExtensionService
* extension_service
);
20 virtual ~ExtensionErrorUIDefault();
22 // ExtensionErrorUI implementation:
23 virtual bool ShowErrorInBubbleView() OVERRIDE
;
24 virtual void ShowExtensions() OVERRIDE
;
25 virtual void Close() OVERRIDE
;
28 class ExtensionGlobalError
: public GlobalError
{
30 explicit ExtensionGlobalError(ExtensionErrorUIDefault
* error_ui
);
33 // GlobalError methods.
34 virtual bool HasMenuItem() OVERRIDE
;
35 virtual int MenuItemCommandID() OVERRIDE
;
36 virtual string16
MenuItemLabel() OVERRIDE
;
37 virtual void ExecuteMenuItem(Browser
* browser
) OVERRIDE
;
38 virtual bool HasBubbleView() OVERRIDE
;
39 virtual string16
GetBubbleViewTitle() OVERRIDE
;
40 virtual std::vector
<string16
> GetBubbleViewMessages() OVERRIDE
;
41 virtual string16
GetBubbleViewAcceptButtonLabel() OVERRIDE
;
42 virtual string16
GetBubbleViewCancelButtonLabel() OVERRIDE
;
43 virtual void OnBubbleViewDidClose(Browser
* browser
) OVERRIDE
;
44 virtual void BubbleViewAcceptButtonPressed(Browser
* browser
) OVERRIDE
;
45 virtual void BubbleViewCancelButtonPressed(Browser
* browser
) OVERRIDE
;
47 // The ExtensionErrorUIDefault who owns us.
48 ExtensionErrorUIDefault
* error_ui_
;
50 DISALLOW_COPY_AND_ASSIGN(ExtensionGlobalError
);
53 // The browser the bubble view was shown into.
56 scoped_ptr
<ExtensionGlobalError
> global_error_
;
58 DISALLOW_COPY_AND_ASSIGN(ExtensionErrorUIDefault
);
61 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_UI_DEFAULT_H_