1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_PARTS_H_
#define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_PARTS_H_
#include <string>
#include <vector>
#include "components/download/public/common/quarantine_connection.h"
#include "mojo/public/cpp/bindings/binder_map.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "storage/browser/file_system/file_system_context.h"
namespace base {
class CommandLine;
class FilePath;
}
namespace blink {
namespace web_pref {
struct WebPreferences;
} // namespace web_pref
class AssociatedInterfaceRegistry;
}
namespace content {
class BrowserChildProcessHost;
class BrowserContext;
class BrowserURLHandler;
class RenderFrameHost;
class RenderProcessHost;
struct ServiceWorkerVersionBaseInfo;
class SiteInstance;
class WebContents;
}
namespace storage {
class FileSystemBackend;
}
// Implements a platform or feature specific part of ChromeContentBrowserClient.
// All the public methods corresponds to the methods of the same name in
// content::ContentBrowserClient.
class ChromeContentBrowserClientParts {
public:
virtual ~ChromeContentBrowserClientParts() = default;
virtual void RenderProcessWillLaunch(content::RenderProcessHost* host) {}
virtual void SiteInstanceGotProcessAndSite(
content::SiteInstance* site_instance) {}
// Subclasses that override webkit preferences are responsible for ensuring
// that their modifications are mututally exclusive.
// This is called at startup, and when the user changes their webkit
// preferences.
virtual void OverrideWebPreferences(
content::WebContents* web_contents,
content::SiteInstance& main_frame_site,
blink::web_pref::WebPreferences* web_prefs) {}
// This is called after each navigation. Return |true| if any changes were
// made. A response value of |true| will result in IPC to the renderer.
virtual bool OverrideWebPreferencesAfterNavigation(
content::WebContents* web_contents,
content::SiteInstance& main_frame_site,
blink::web_pref::WebPreferences* web_prefs);
virtual void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) {}
virtual void GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_allowed_schemes) {}
virtual void GetURLRequestAutoMountHandlers(
std::vector<storage::URLRequestAutoMountHandler>* handlers) {}
virtual void GetAdditionalFileSystemBackends(
content::BrowserContext* browser_context,
const base::FilePath& storage_partition_path,
download::QuarantineConnectionCallback quarantine_connection_callback,
std::vector<std::unique_ptr<storage::FileSystemBackend>>*
additional_backends) {}
// Append extra switches to |command_line| for |process|.
virtual void AppendExtraRendererCommandLineSwitches(
base::CommandLine* command_line,
content::RenderProcessHost& process) {}
// Allows to register browser interfaces exposed through the
// RenderProcessHost. Note that interface factory callbacks added to
// |registry| will by default be run immediately on the IO thread, unless a
// task runner is provided.
virtual void ExposeInterfacesToRenderer(
service_manager::BinderRegistry* registry,
blink::AssociatedInterfaceRegistry* associated_registry,
content::RenderProcessHost* render_process_host) {}
// Allows to register browser interfaces exposed through the
// BrowserChildProcessHost. Note that interface factory callbacks added to
// `map` will by default be run immediately on the IO thread, unless a task
// runner is provided.
virtual void ExposeInterfacesToChild(
mojo::BinderMapWithContext<content::BrowserChildProcessHost*>* map) {}
// Allows to register browser interfaces exposed to a ServiceWorker.
virtual void ExposeInterfacesToRendererForServiceWorker(
const content::ServiceWorkerVersionBaseInfo& service_worker_version_info,
blink::AssociatedInterfaceRegistry& associated_registry) {}
// Allows to register browser interfaces exposed to a RenderFrameHost.
virtual void ExposeInterfacesToRendererForRenderFrameHost(
content::RenderFrameHost& frame_host,
blink::AssociatedInterfaceRegistry& associated_registry) {}
};
#endif // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_PARTS_H_
|