Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / extensions / shell / browser / shell_content_browser_client.h
blob16e51ca448516b202795243a245d02c085e75a2f
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"
11 class GURL;
13 namespace base {
14 class CommandLine;
17 namespace content {
18 class BrowserContext;
21 namespace extensions {
22 class Extension;
23 class ShellBrowserMainDelegate;
24 class ShellBrowserMainParts;
26 // Content module browser process support for app_shell.
27 class ShellContentBrowserClient : public content::ContentBrowserClient {
28 public:
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 bool IsHandledURL(const GURL& url) override;
51 void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
52 void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
53 void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
54 int child_process_id) override;
55 content::SpeechRecognitionManagerDelegate*
56 CreateSpeechRecognitionManagerDelegate() override;
57 content::BrowserPpapiHost* GetExternalBrowserPpapiHost(
58 int plugin_process_id) override;
59 void GetAdditionalAllowedSchemesForFileSystem(
60 std::vector<std::string>* additional_schemes) override;
61 content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
63 protected:
64 // Subclasses may wish to provide their own ShellBrowserMainParts.
65 virtual ShellBrowserMainParts* CreateShellBrowserMainParts(
66 const content::MainFunctionParams& parameters,
67 ShellBrowserMainDelegate* browser_main_delegate);
69 private:
70 // Appends command line switches for a renderer process.
71 void AppendRendererSwitches(base::CommandLine* command_line);
73 // Returns the extension or app associated with |site_instance| or NULL.
74 const Extension* GetExtension(content::SiteInstance* site_instance);
76 // Owned by content::BrowserMainLoop.
77 ShellBrowserMainParts* browser_main_parts_;
79 // Owned by ShellBrowserMainParts.
80 ShellBrowserMainDelegate* browser_main_delegate_;
82 DISALLOW_COPY_AND_ASSIGN(ShellContentBrowserClient);
85 } // namespace extensions
87 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_