[email protected] | de7d61ff | 2013-08-20 11:30:41 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
[email protected] | 5629e0c | 2011-09-12 22:07:36 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | de7d61ff | 2013-08-20 11:30:41 | [diff] [blame] | 5 | #ifndef CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ |
6 | #define CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ | ||||
[email protected] | 5629e0c | 2011-09-12 22:07:36 | [diff] [blame] | 7 | |
dcheng | 6003e0b | 2016-04-09 18:42:34 | [diff] [blame] | 8 | #include <memory> |
[email protected] | 5629e0c | 2011-09-12 22:07:36 | [diff] [blame] | 9 | #include <string> |
10 | |||||
Jun Cai | bc561f41 | 2018-02-28 18:41:39 | [diff] [blame] | 11 | #include "base/callback.h" |
[email protected] | 5629e0c | 2011-09-12 22:07:36 | [diff] [blame] | 12 | #include "base/compiler_specific.h" |
[email protected] | 5799981 | 2013-02-24 05:40:52 | [diff] [blame] | 13 | #include "base/files/file_path.h" |
avi | 66a0772 | 2015-12-25 23:38:12 | [diff] [blame] | 14 | #include "build/build_config.h" |
[email protected] | 87f3c08 | 2011-10-19 18:07:44 | [diff] [blame] | 15 | #include "content/public/browser/content_browser_client.h" |
[email protected] | 9896c55 | 2013-08-29 19:03:20 | [diff] [blame] | 16 | #include "content/shell/browser/shell_speech_recognition_manager_delegate.h" |
Ben Goodger | 6a695c01 | 2017-06-20 20:21:20 | [diff] [blame] | 17 | #include "services/service_manager/public/cpp/binder_registry.h" |
[email protected] | 5629e0c | 2011-09-12 22:07:36 | [diff] [blame] | 18 | |
19 | namespace content { | ||||
20 | |||||
Jun Cai | bc561f41 | 2018-02-28 18:41:39 | [diff] [blame] | 21 | class ResourceDispatcherHostDelegate; |
[email protected] | 147f809 | 2012-03-21 11:47:45 | [diff] [blame] | 22 | class ShellBrowserContext; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 23 | class ShellBrowserMainParts; |
24 | |||||
[email protected] | 7f550087 | 2013-11-12 20:03:54 | [diff] [blame] | 25 | class ShellContentBrowserClient : public ContentBrowserClient { |
[email protected] | 5629e0c | 2011-09-12 22:07:36 | [diff] [blame] | 26 | public: |
[email protected] | eabbfb1 | 2013-04-05 23:28:35 | [diff] [blame] | 27 | // Gets the current instance. |
28 | static ShellContentBrowserClient* Get(); | ||||
29 | |||||
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 30 | ShellContentBrowserClient(); |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 31 | ~ShellContentBrowserClient() override; |
[email protected] | 5629e0c | 2011-09-12 22:07:36 | [diff] [blame] | 32 | |
[email protected] | bdcf915 | 2012-07-19 17:43:21 | [diff] [blame] | 33 | // ContentBrowserClient overrides. |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 34 | BrowserMainParts* CreateBrowserMainParts( |
anand.ratn | 449f39a4 | 2014-10-06 13:45:57 | [diff] [blame] | 35 | const MainFunctionParams& parameters) override; |
nick | d410644 | 2015-12-08 21:53:11 | [diff] [blame] | 36 | bool DoesSiteRequireDedicatedProcess(BrowserContext* browser_context, |
nick | db193a1 | 2016-09-09 23:09:23 | [diff] [blame] | 37 | const GURL& effective_site_url) override; |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 38 | bool IsHandledURL(const GURL& url) override; |
Ben Goodger | 6a695c01 | 2017-06-20 20:21:20 | [diff] [blame] | 39 | void BindInterfaceRequestFromFrame( |
40 | content::RenderFrameHost* render_frame_host, | ||||
Ben Goodger | 6a695c01 | 2017-06-20 20:21:20 | [diff] [blame] | 41 | const std::string& interface_name, |
42 | mojo::ScopedMessagePipeHandle interface_pipe) override; | ||||
Scott Violet | b7f4df2 | 2018-05-17 04:43:12 | [diff] [blame] | 43 | void RegisterInProcessServices(StaticServiceMap* services, |
44 | ServiceManagerConnection* connection) override; | ||||
ben | d32292b | 2016-10-07 00:21:58 | [diff] [blame] | 45 | void RegisterOutOfProcessServices(OutOfProcessServiceMap* services) override; |
James Cook | 5b2b398 | 2017-10-17 03:04:21 | [diff] [blame] | 46 | bool ShouldTerminateOnServiceQuit( |
47 | const service_manager::Identity& id) override; | ||||
ben | 6c7a8a7 | 2016-09-30 18:35:21 | [diff] [blame] | 48 | std::unique_ptr<base::Value> GetServiceManifestOverlay( |
sammc | 2b0375b | 2016-12-22 01:26:17 | [diff] [blame] | 49 | base::StringPiece name) override; |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 50 | void AppendExtraCommandLineSwitches(base::CommandLine* command_line, |
51 | int child_process_id) override; | ||||
Xiyuan Xia | af075dbd | 2018-09-19 18:14:12 | [diff] [blame^] | 52 | void AdjustUtilityServiceProcessCommandLine( |
53 | const service_manager::Identity& identity, | ||||
54 | base::CommandLine* command_line) override; | ||||
Matt Menke | eda739b | 2018-07-31 18:51:28 | [diff] [blame] | 55 | std::string GetAcceptLangs(BrowserContext* context) override; |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 56 | void ResourceDispatcherHostCreated() override; |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 57 | std::string GetDefaultDownloadName() override; |
58 | WebContentsViewDelegate* GetWebContentsViewDelegate( | ||||
anand.ratn | 449f39a4 | 2014-10-06 13:45:57 | [diff] [blame] | 59 | WebContents* web_contents) override; |
dcheng | e933b3e | 2014-10-21 11:44:09 | [diff] [blame] | 60 | QuotaPermissionContext* CreateQuotaPermissionContext() override; |
michaeln | 10e5fc35 | 2017-02-07 02:07:58 | [diff] [ |