1 // Copyright 2014 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_PARTS_H_
6 #define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_PARTS_H_
11 #include "components/download/public/common/quarantine_connection.h"
12 #include "services/service_manager/public/cpp/binder_registry.h"
13 #include "storage/browser/file_system/file_system_context.h"
22 struct WebPreferences;
23 } // namespace web_pref
24 class AssociatedInterfaceRegistry;
29 class BrowserURLHandler;
30 class RenderFrameHost;
31 class RenderProcessHost;
32 struct ServiceWorkerVersionBaseInfo;
38 class FileSystemBackend;
43 // Implements a platform or feature specific part of ChromeContentBrowserClient.
44 // All the public methods corresponds to the methods of the same name in
45 // content::ContentBrowserClient.
46 class ChromeContentBrowserClientParts {
48 virtual ~ChromeContentBrowserClientParts() {}
50 virtual void RenderProcessWillLaunch(content::RenderProcessHost* host) {}
51 virtual void SiteInstanceGotProcess(content::SiteInstance* site_instance) {}
53 // Subclasses that override webkit preferences are responsible for ensuring
54 // that their modifications are mututally exclusive.
55 // This is called at startup, and when the user changes their webkit
57 virtual void OverrideWebkitPrefs(content::WebContents* web_contents,
58 blink::web_pref::WebPreferences* web_prefs) {
60 // This is called after each navigation. Return |true| if any changes were
61 // made. A response value of |true| will result in IPC to the renderer.
62 virtual bool OverrideWebPreferencesAfterNavigation(
63 content::WebContents* web_contents,
64 blink::web_pref::WebPreferences* web_prefs);
66 virtual void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) {}
67 virtual void GetAdditionalAllowedSchemesForFileSystem(
68 std::vector<std::string>* additional_allowed_schemes) {}
69 virtual void GetURLRequestAutoMountHandlers(
70 std::vector<storage::URLRequestAutoMountHandler>* handlers) {}
71 virtual void GetAdditionalFileSystemBackends(
72 content::BrowserContext* browser_context,
73 const base::FilePath& storage_partition_path,
74 download::QuarantineConnectionCallback quarantine_connection_callback,
75 std::vector<std::unique_ptr<storage::FileSystemBackend>>*
76 additional_backends) {}
78 // Append extra switches to |command_line| for |process|. If |process| is not
79 // NULL, then neither is |profile|.
80 virtual void AppendExtraRendererCommandLineSwitches(
81 base::CommandLine* command_line,
82 content::RenderProcessHost* process,
85 // Allows to register browser interfaces exposed through the
86 // RenderProcessHost. Note that interface factory callbacks added to
87 // |registry| will by default be run immediately on the IO thread, unless a
88 // task runner is provided.
89 virtual void ExposeInterfacesToRenderer(
90 service_manager::BinderRegistry* registry,
91 blink::AssociatedInterfaceRegistry* associated_registry,
92 content::RenderProcessHost* render_process_host) {}
94 // Allows to register browser interfaces exposed to a ServiceWorker.
95 virtual void ExposeInterfacesToRendererForServiceWorker(
96 const content::ServiceWorkerVersionBaseInfo& service_worker_version_info,
97 blink::AssociatedInterfaceRegistry& associated_registry) {}
99 // Allows to register browser interfaces exposed to a RenderFrameHost.
100 virtual void ExposeInterfacesToRendererForRenderFrameHost(
101 content::RenderFrameHost& frame_host,
102 blink::AssociatedInterfaceRegistry& associated_registry) {}
105 #endif // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_PARTS_H_