OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par
t.h" | 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par
t.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/extensions/browser_permissions_policy_delegate.h" | 13 #include "chrome/browser/extensions/browser_permissions_policy_delegate.h" |
14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
15 #include "chrome/browser/extensions/extension_web_ui.h" | 15 #include "chrome/browser/extensions/extension_web_ui.h" |
16 #include "chrome/browser/extensions/extension_webkit_preferences.h" | 16 #include "chrome/browser/extensions/extension_webkit_preferences.h" |
17 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" | 17 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/profiles/profile_io_data.h" | 19 #include "chrome/browser/profiles/profile_io_data.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/renderer_host/chrome_extension_message_filter.h" | 21 #include "chrome/browser/renderer_host/chrome_extension_message_filter.h" |
22 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | 22 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" |
23 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/extensions/extension_process_policy.h" | 25 #include "chrome/common/extensions/extension_process_policy.h" |
26 #include "components/guest_view/browser/guest_view_message_filter.h" | |
27 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
28 #include "content/public/browser/browser_url_handler.h" | 27 #include "content/public/browser/browser_url_handler.h" |
29 #include "content/public/browser/render_process_host.h" | 28 #include "content/public/browser/render_process_host.h" |
30 #include "content/public/browser/render_view_host.h" | 29 #include "content/public/browser/render_view_host.h" |
31 #include "content/public/browser/site_instance.h" | 30 #include "content/public/browser/site_instance.h" |
32 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
33 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
34 #include "extensions/browser/api/web_request/web_request_api.h" | 33 #include "extensions/browser/api/web_request/web_request_api.h" |
35 #include "extensions/browser/api/web_request/web_request_api_helpers.h" | 34 #include "extensions/browser/api/web_request/web_request_api_helpers.h" |
36 #include "extensions/browser/extension_host.h" | 35 #include "extensions/browser/extension_host.h" |
37 #include "extensions/browser/extension_message_filter.h" | 36 #include "extensions/browser/extension_message_filter.h" |
38 #include "extensions/browser/extension_registry.h" | 37 #include "extensions/browser/extension_registry.h" |
39 #include "extensions/browser/extension_system.h" | 38 #include "extensions/browser/extension_system.h" |
40 #include "extensions/browser/guest_view/extensions_guest_view_message_filter.h" | |
41 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" | 39 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" |
42 #include "extensions/browser/info_map.h" | 40 #include "extensions/browser/info_map.h" |
43 #include "extensions/browser/io_thread_extension_message_filter.h" | 41 #include "extensions/browser/io_thread_extension_message_filter.h" |
44 #include "extensions/browser/view_type_utils.h" | 42 #include "extensions/browser/view_type_utils.h" |
45 #include "extensions/common/constants.h" | 43 #include "extensions/common/constants.h" |
46 #include "extensions/common/manifest_constants.h" | 44 #include "extensions/common/manifest_constants.h" |
47 #include "extensions/common/manifest_handlers/app_isolation_info.h" | 45 #include "extensions/common/manifest_handlers/app_isolation_info.h" |
48 #include "extensions/common/manifest_handlers/background_info.h" | 46 #include "extensions/common/manifest_handlers/background_info.h" |
49 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" | 47 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" |
50 #include "extensions/common/switches.h" | 48 #include "extensions/common/switches.h" |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 } | 479 } |
482 | 480 |
483 void ChromeContentBrowserClientExtensionsPart::RenderProcessWillLaunch( | 481 void ChromeContentBrowserClientExtensionsPart::RenderProcessWillLaunch( |
484 content::RenderProcessHost* host) { | 482 content::RenderProcessHost* host) { |
485 int id = host->GetID(); | 483 int id = host->GetID(); |
486 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 484 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
487 | 485 |
488 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); | 486 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); |
489 host->AddFilter(new ExtensionMessageFilter(id, profile)); | 487 host->AddFilter(new ExtensionMessageFilter(id, profile)); |
490 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile)); | 488 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile)); |
491 host->AddFilter(new ExtensionsGuestViewMessageFilter(id, profile)); | |
492 extension_web_request_api_helpers::SendExtensionWebRequestStatusToHost(host); | 489 extension_web_request_api_helpers::SendExtensionWebRequestStatusToHost(host); |
493 } | 490 } |
494 | 491 |
495 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess( | 492 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess( |
496 SiteInstance* site_instance) { | 493 SiteInstance* site_instance) { |
497 BrowserContext* context = site_instance->GetProcess()->GetBrowserContext(); | 494 BrowserContext* context = site_instance->GetProcess()->GetBrowserContext(); |
498 ExtensionRegistry* registry = ExtensionRegistry::Get(context); | 495 ExtensionRegistry* registry = ExtensionRegistry::Get(context); |
499 if (!registry) | 496 if (!registry) |
500 return; | 497 return; |
501 | 498 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); | 611 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); |
615 #endif | 612 #endif |
616 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 613 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
617 switches::kEnableMojoSerialService)) { | 614 switches::kEnableMojoSerialService)) { |
618 command_line->AppendSwitch(switches::kEnableMojoSerialService); | 615 command_line->AppendSwitch(switches::kEnableMojoSerialService); |
619 } | 616 } |
620 } | 617 } |
621 } | 618 } |
622 | 619 |
623 } // namespace extensions | 620 } // namespace extensions |
OLD | NEW |