Roll src/third_party/skia 2440fcd:4de8c3a
[chromium-blink-merge.git] / content / shell / browser / shell_content_browser_client.h
blob6eb56b96ca0e1299f4d06d47d073b6d9741533fd
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 CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
6 #define CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "base/files/file_path.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "content/public/browser/content_browser_client.h"
14 #include "content/shell/browser/shell_speech_recognition_manager_delegate.h"
16 namespace content {
18 class ShellBrowserContext;
19 class ShellBrowserMainParts;
20 class ShellResourceDispatcherHostDelegate;
22 class ShellContentBrowserClient : public ContentBrowserClient {
23 public:
24 // Gets the current instance.
25 static ShellContentBrowserClient* Get();
27 static void SetSwapProcessesForRedirect(bool swap);
29 ShellContentBrowserClient();
30 ~ShellContentBrowserClient() override;
32 // ContentBrowserClient overrides.
33 BrowserMainParts* CreateBrowserMainParts(
34 const MainFunctionParams& parameters) override;
35 void RenderProcessWillLaunch(RenderProcessHost* host) override;
36 net::URLRequestContextGetter* CreateRequestContext(
37 BrowserContext* browser_context,
38 ProtocolHandlerMap* protocol_handlers,
39 URLRequestInterceptorScopedVector request_interceptors) override;
40 net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
41 BrowserContext* browser_context,
42 const base::FilePath& partition_path,
43 bool in_memory,
44 ProtocolHandlerMap* protocol_handlers,
45 URLRequestInterceptorScopedVector request_interceptors) override;
46 bool IsHandledURL(const GURL& url) override;
47 bool IsNPAPIEnabled() override;
48 void RegisterOutOfProcessMojoApplications(
49 OutOfProcessMojoApplicationMap* apps) override;
50 void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
51 int child_process_id) override;
52 void OverrideWebkitPrefs(RenderViewHost* render_view_host,
53 WebPreferences* prefs) override;
54 void ResourceDispatcherHostCreated() override;
55 AccessTokenStore* CreateAccessTokenStore() override;
56 std::string GetDefaultDownloadName() override;
57 WebContentsViewDelegate* GetWebContentsViewDelegate(
58 WebContents* web_contents) override;
59 QuotaPermissionContext* CreateQuotaPermissionContext() override;
60 void SelectClientCertificate(
61 WebContents* web_contents,
62 net::SSLCertRequestInfo* cert_request_info,
63 scoped_ptr<ClientCertificateDelegate> delegate) override;
65 SpeechRecognitionManagerDelegate* CreateSpeechRecognitionManagerDelegate()
66 override;
67 net::NetLog* GetNetLog() override;
68 bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context,
69 const GURL& current_url,
70 const GURL& new_url) override;
71 DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
73 void OpenURL(BrowserContext* browser_context,
74 const OpenURLParams& params,
75 const base::Callback<void(WebContents*)>& callback) override;
77 #if defined(OS_ANDROID)
78 void GetAdditionalMappedFilesForChildProcess(
79 const base::CommandLine& command_line,
80 int child_process_id,
81 content::FileDescriptorInfo* mappings,
82 std::map<int, base::MemoryMappedFile::Region>* regions) override;
83 #elif defined(OS_POSIX) && !defined(OS_MACOSX)
84 void GetAdditionalMappedFilesForChildProcess(
85 const base::CommandLine& command_line,
86 int child_process_id,
87 content::FileDescriptorInfo* mappings) override;
88 #endif // defined(OS_ANDROID)
89 #if defined(OS_WIN)
90 void PreSpawnRenderer(sandbox::TargetPolicy* policy, bool* success) override;
91 #endif
93 ShellBrowserContext* browser_context();
94 ShellBrowserContext* off_the_record_browser_context();
95 ShellResourceDispatcherHostDelegate* resource_dispatcher_host_delegate() {
96 return resource_dispatcher_host_delegate_.get();
98 ShellBrowserMainParts* shell_browser_main_parts() {
99 return shell_browser_main_parts_;
102 // Used for content_browsertests.
103 void set_select_client_certificate_callback(
104 base::Closure select_client_certificate_callback) {
105 select_client_certificate_callback_ = select_client_certificate_callback;
108 private:
109 ShellBrowserContext* ShellBrowserContextForBrowserContext(
110 BrowserContext* content_browser_context);
112 scoped_ptr<ShellResourceDispatcherHostDelegate>
113 resource_dispatcher_host_delegate_;
115 base::Closure select_client_certificate_callback_;
117 ShellBrowserMainParts* shell_browser_main_parts_;
120 } // namespace content
122 #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_