1 // Copyright 2014 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 EXTENSIONS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
6 #define EXTENSIONS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
8 #include "base/compiler_specific.h"
9 #include "content/public/browser/content_browser_client.h"
21 namespace extensions
{
23 class ShellBrowserMainDelegate
;
24 class ShellBrowserMainParts
;
26 // Content module browser process support for app_shell.
27 class ShellContentBrowserClient
: public content::ContentBrowserClient
{
29 explicit ShellContentBrowserClient(
30 ShellBrowserMainDelegate
* browser_main_delegate
);
31 ~ShellContentBrowserClient() override
;
33 // Returns the single instance.
34 static ShellContentBrowserClient
* Get();
36 // Returns the single browser context for app_shell.
37 content::BrowserContext
* GetBrowserContext();
39 // content::ContentBrowserClient overrides.
40 content::BrowserMainParts
* CreateBrowserMainParts(
41 const content::MainFunctionParams
& parameters
) override
;
42 void RenderProcessWillLaunch(content::RenderProcessHost
* host
) override
;
43 bool ShouldUseProcessPerSite(content::BrowserContext
* browser_context
,
44 const GURL
& effective_url
) override
;
45 net::URLRequestContextGetter
* CreateRequestContext(
46 content::BrowserContext
* browser_context
,
47 content::ProtocolHandlerMap
* protocol_handlers
,
48 content::URLRequestInterceptorScopedVector request_interceptors
) override
;
49 // TODO(jamescook): Quota management?
50 // TODO(jamescook): Speech recognition?
51 bool IsHandledURL(const GURL
& url
) override
;
52 void SiteInstanceGotProcess(content::SiteInstance
* site_instance
) override
;
53 void SiteInstanceDeleting(content::SiteInstance
* site_instance
) override
;
54 void AppendExtraCommandLineSwitches(base::CommandLine
* command_line
,
55 int child_process_id
) override
;
56 content::BrowserPpapiHost
* GetExternalBrowserPpapiHost(
57 int plugin_process_id
) override
;
58 void GetAdditionalAllowedSchemesForFileSystem(
59 std::vector
<std::string
>* additional_schemes
) override
;
60 content::DevToolsManagerDelegate
* GetDevToolsManagerDelegate() override
;
63 // Appends command line switches for a renderer process.
64 void AppendRendererSwitches(base::CommandLine
* command_line
);
66 // Returns the extension or app associated with |site_instance| or NULL.
67 const Extension
* GetExtension(content::SiteInstance
* site_instance
);
69 // Owned by content::BrowserMainLoop.
70 ShellBrowserMainParts
* browser_main_parts_
;
72 // Owned by ShellBrowserMainParts.
73 ShellBrowserMainDelegate
* browser_main_delegate_
;
75 DISALLOW_COPY_AND_ASSIGN(ShellContentBrowserClient
);
78 } // namespace extensions
80 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_