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_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_
6 #define APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_
8 #include "base/compiler_specific.h"
9 #include "extensions/browser/extensions_browser_client.h"
13 namespace extensions {
15 // An ExtensionsBrowserClient that supports a single content::BrowserContent
16 // with no related incognito context.
17 class ShellExtensionsBrowserClient : public ExtensionsBrowserClient {
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)
32 virtual content::BrowserContext* GetOffTheRecordContext(
33 content::BrowserContext* context) OVERRIDE;
34 virtual content::BrowserContext* GetOriginalContext(
35 content::BrowserContext* context) OVERRIDE;
36 virtual bool IsGuestSession(content::BrowserContext* context) OVERRIDE;
37 virtual bool IsExtensionIncognitoEnabled(
38 const std::string& extension_id,
39 content::BrowserContext* context) const OVERRIDE;
40 virtual bool CanExtensionCrossIncognito(
41 const extensions::Extension* extension,
42 content::BrowserContext* context) const OVERRIDE;
43 virtual PrefService* GetPrefServiceForContext(
44 content::BrowserContext* context) OVERRIDE;
45 virtual bool DeferLoadingBackgroundHosts(content::BrowserContext* context)
47 virtual bool IsBackgroundPageAllowed(content::BrowserContext* context)
49 virtual void OnExtensionHostCreated(content::WebContents* web_contents)
51 virtual void OnRenderViewCreatedForBackgroundPage(ExtensionHost* host)
53 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE;
54 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE;
55 virtual bool IsRunningInForcedAppMode() OVERRIDE;
56 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager()
58 virtual ApiActivityMonitor* GetApiActivityMonitor(
59 content::BrowserContext* context) OVERRIDE;
60 virtual ExtensionSystemProvider* GetExtensionSystemFactory() OVERRIDE;
63 // The single BrowserContext for app_shell. Not owned.
64 content::BrowserContext* browser_context_;
66 // The PrefService for |browser_context_|.
67 scoped_ptr<PrefService> prefs_;
69 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsBrowserClient);
72 } // namespace extensions
74 #endif // APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_