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 |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "content/public/browser/render_process_host.h" | 28 #include "content/public/browser/render_process_host.h" |
29 #include "content/public/browser/render_view_host.h" | 29 #include "content/public/browser/render_view_host.h" |
30 #include "content/public/browser/site_instance.h" | 30 #include "content/public/browser/site_instance.h" |
31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
32 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
33 #include "extensions/browser/api/web_request/web_request_api.h" | 33 #include "extensions/browser/api/web_request/web_request_api.h" |
34 #include "extensions/browser/api/web_request/web_request_api_helpers.h" | 34 #include "extensions/browser/api/web_request/web_request_api_helpers.h" |
35 #include "extensions/browser/extension_host.h" | 35 #include "extensions/browser/extension_host.h" |
36 #include "extensions/browser/extension_message_filter.h" | 36 #include "extensions/browser/extension_message_filter.h" |
37 #include "extensions/browser/extension_registry.h" | 37 #include "extensions/browser/extension_registry.h" |
| 38 #include "extensions/browser/extension_service_worker_message_filter.h" |
38 #include "extensions/browser/extension_system.h" | 39 #include "extensions/browser/extension_system.h" |
39 #include "extensions/browser/guest_view/extensions_guest_view_message_filter.h" | 40 #include "extensions/browser/guest_view/extensions_guest_view_message_filter.h" |
40 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" | 41 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" |
41 #include "extensions/browser/info_map.h" | 42 #include "extensions/browser/info_map.h" |
42 #include "extensions/browser/io_thread_extension_message_filter.h" | 43 #include "extensions/browser/io_thread_extension_message_filter.h" |
43 #include "extensions/browser/view_type_utils.h" | 44 #include "extensions/browser/view_type_utils.h" |
44 #include "extensions/common/constants.h" | 45 #include "extensions/common/constants.h" |
| 46 #include "extensions/common/extensions_client.h" |
45 #include "extensions/common/manifest_constants.h" | 47 #include "extensions/common/manifest_constants.h" |
46 #include "extensions/common/manifest_handlers/app_isolation_info.h" | 48 #include "extensions/common/manifest_handlers/app_isolation_info.h" |
47 #include "extensions/common/manifest_handlers/background_info.h" | 49 #include "extensions/common/manifest_handlers/background_info.h" |
48 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" | 50 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" |
49 #include "extensions/common/permissions/permissions_data.h" | 51 #include "extensions/common/permissions/permissions_data.h" |
50 #include "extensions/common/switches.h" | 52 #include "extensions/common/switches.h" |
51 | 53 |
52 using content::BrowserContext; | 54 using content::BrowserContext; |
53 using content::BrowserThread; | 55 using content::BrowserThread; |
54 using content::BrowserURLHandler; | 56 using content::BrowserURLHandler; |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 | 491 |
490 void ChromeContentBrowserClientExtensionsPart::RenderProcessWillLaunch( | 492 void ChromeContentBrowserClientExtensionsPart::RenderProcessWillLaunch( |
491 content::RenderProcessHost* host) { | 493 content::RenderProcessHost* host) { |
492 int id = host->GetID(); | 494 int id = host->GetID(); |
493 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 495 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
494 | 496 |
495 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); | 497 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); |
496 host->AddFilter(new ExtensionMessageFilter(id, profile)); | 498 host->AddFilter(new ExtensionMessageFilter(id, profile)); |
497 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile)); | 499 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile)); |
498 host->AddFilter(new ExtensionsGuestViewMessageFilter(id, profile)); | 500 host->AddFilter(new ExtensionsGuestViewMessageFilter(id, profile)); |
| 501 if (extensions::ExtensionsClient::Get() |
| 502 ->ExtensionAPIEnabledInExtensionServiceWorkers()) { |
| 503 host->AddFilter(new ExtensionServiceWorkerMessageFilter(id, profile)); |
| 504 } |
499 extension_web_request_api_helpers::SendExtensionWebRequestStatusToHost(host); | 505 extension_web_request_api_helpers::SendExtensionWebRequestStatusToHost(host); |
500 } | 506 } |
501 | 507 |
502 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess( | 508 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess( |
503 SiteInstance* site_instance) { | 509 SiteInstance* site_instance) { |
504 BrowserContext* context = site_instance->GetProcess()->GetBrowserContext(); | 510 BrowserContext* context = site_instance->GetProcess()->GetBrowserContext(); |
505 ExtensionRegistry* registry = ExtensionRegistry::Get(context); | 511 ExtensionRegistry* registry = ExtensionRegistry::Get(context); |
506 if (!registry) | 512 if (!registry) |
507 return; | 513 return; |
508 | 514 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); | 627 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); |
622 #endif | 628 #endif |
623 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 629 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
624 switches::kEnableMojoSerialService)) { | 630 switches::kEnableMojoSerialService)) { |
625 command_line->AppendSwitch(switches::kEnableMojoSerialService); | 631 command_line->AppendSwitch(switches::kEnableMojoSerialService); |
626 } | 632 } |
627 } | 633 } |
628 } | 634 } |
629 | 635 |
630 } // namespace extensions | 636 } // namespace extensions |
OLD | NEW |