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 "extensions/common/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 GlobalErrorWithStandardBubble
{
30 explicit ExtensionGlobalError(ExtensionErrorUIDefault
* error_ui
);
33 // GlobalError methods.
34 virtual bool HasMenuItem() OVERRIDE
;
35 virtual int MenuItemCommandID() OVERRIDE
;
36 virtual base::string16
MenuItemLabel() OVERRIDE
;
37 virtual void ExecuteMenuItem(Browser
* browser
) OVERRIDE
;
38 virtual base::string16
GetBubbleViewTitle() OVERRIDE
;
39 virtual std::vector
<base::string16
> GetBubbleViewMessages() OVERRIDE
;
40 virtual base::string16
GetBubbleViewAcceptButtonLabel() OVERRIDE
;
41 virtual base::string16
GetBubbleViewCancelButtonLabel() OVERRIDE
;
42 virtual void OnBubbleViewDidClose(Browser
* browser
) OVERRIDE
;
43 virtual void BubbleViewAcceptButtonPressed(Browser
* browser
) OVERRIDE
;
44 virtual void BubbleViewCancelButtonPressed(Browser
* browser
) OVERRIDE
;
46 // The ExtensionErrorUIDefault who owns us.
47 ExtensionErrorUIDefault
* error_ui_
;
49 DISALLOW_COPY_AND_ASSIGN(ExtensionGlobalError
);
52 // The browser the bubble view was shown into.
55 scoped_ptr
<ExtensionGlobalError
> global_error_
;
57 DISALLOW_COPY_AND_ASSIGN(ExtensionErrorUIDefault
);
60 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_UI_DEFAULT_H_