Close crashed incognito-mode app's shell window.
[chromium-blink-merge.git] / apps / shell / shell_extensions_browser_client.h
blob86781b5c8455b6e749f5d2de6f043a55814d94ff
1 // Copyright 2013 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 APPS_SHELL_SHELL_EXTENSIONS_BROWSER_CLIENT_H_
6 #define APPS_SHELL_SHELL_EXTENSIONS_BROWSER_CLIENT_H_
8 #include "base/compiler_specific.h"
9 #include "extensions/browser/extensions_browser_client.h"
11 class PrefService;
13 namespace extensions {
15 // An ExtensionsBrowserClient that supports a single content::BrowserContent
16 // with no related incognito context.
17 class ShellExtensionsBrowserClient : public ExtensionsBrowserClient {
18 public:
19 // |context| is the single BrowserContext used for IsValidContext() below.
20 explicit ShellExtensionsBrowserClient(content::BrowserContext* context);
21 virtual ~ShellExtensionsBrowserClient();
23 // ExtensionsBrowserClient overrides:
24 virtual bool IsShuttingDown() OVERRIDE;
25 virtual bool AreExtensionsDisabled(const CommandLine& command_line,
26 content::BrowserContext* context) OVERRIDE;
27 virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE;
28 virtual bool IsSameContext(content::BrowserContext* first,
29 content::BrowserContext* second) OVERRIDE;
30 virtual bool HasOffTheRecordContext(content::BrowserContext* context)
31 OVERRIDE;
32 virtual content::BrowserContext* GetOffTheRecordContext(
33 content::BrowserContext* context) OVERRIDE;
34 virtual content::BrowserContext* GetOriginalContext(
35 content::BrowserContext* context) OVERRIDE;
36 virtual PrefService* GetPrefServiceForContext(
37 content::BrowserContext* context) OVERRIDE;
38 virtual bool DeferLoadingBackgroundHosts(content::BrowserContext* context)
39 const OVERRIDE;
40 virtual bool IsBackgroundPageAllowed(content::BrowserContext* context)
41 const OVERRIDE;
42 virtual void OnExtensionHostCreated(content::WebContents* web_contents)
43 OVERRIDE;
44 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE;
45 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE;
46 virtual bool IsRunningInForcedAppMode() OVERRIDE;
47 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager()
48 OVERRIDE;
49 virtual std::vector<BrowserContextKeyedServiceFactory*>
50 GetExtensionSystemDependencies() OVERRIDE;
51 virtual ExtensionSystem* CreateExtensionSystem(
52 content::BrowserContext* context) OVERRIDE;
54 private:
55 // The single BrowserContext for app_shell. Not owned.
56 content::BrowserContext* browser_context_;
58 // The PrefService for |browser_context_|.
59 scoped_ptr<PrefService> prefs_;
61 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsBrowserClient);
64 } // namespace extensions
66 #endif // APPS_SHELL_SHELL_EXTENSIONS_BROWSER_CLIENT_H_