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_CONTENT_BROWSER_CLIENT_H_
6 #define APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
8 #include "base/compiler_specific.h"
9 #include "content/public/browser/content_browser_client.h"
17 namespace extensions {
22 class ShellBrowserMainParts;
24 // Content module browser process support for app_shell.
25 class ShellContentBrowserClient : public content::ContentBrowserClient {
27 ShellContentBrowserClient();
28 virtual ~ShellContentBrowserClient();
30 // Returns the single instance.
31 static ShellContentBrowserClient* Get();
33 // Returns the single browser context for app_shell.
34 content::BrowserContext* GetBrowserContext();
36 // content::ContentBrowserClient overrides.
37 virtual content::BrowserMainParts* CreateBrowserMainParts(
38 const content::MainFunctionParams& parameters) OVERRIDE;
39 virtual void RenderProcessWillLaunch(
40 content::RenderProcessHost* host) OVERRIDE;
41 virtual bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
42 const GURL& effective_url) OVERRIDE;
43 virtual net::URLRequestContextGetter* CreateRequestContext(
44 content::BrowserContext* browser_context,
45 content::ProtocolHandlerMap* protocol_handlers,
46 content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE;
47 // TODO(jamescook): Quota management?
48 // TODO(jamescook): Speech recognition?
49 virtual bool IsHandledURL(const GURL& url) OVERRIDE;
50 virtual void SiteInstanceGotProcess(content::SiteInstance* site_instance)
52 virtual void SiteInstanceDeleting(content::SiteInstance* site_instance)
54 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
55 int child_process_id) OVERRIDE;
56 virtual void GetAdditionalAllowedSchemesForFileSystem(
57 std::vector<std::string>* additional_schemes) OVERRIDE;
60 // Returns the extension or app associated with |site_instance| or NULL.
61 const extensions::Extension* GetExtension(
62 content::SiteInstance* site_instance);
64 // Owned by content::BrowserMainLoop.
65 ShellBrowserMainParts* browser_main_parts_;
67 DISALLOW_COPY_AND_ASSIGN(ShellContentBrowserClient);
72 #endif // APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_