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 "extensions/shell/browser/shell_content_browser_client.h" | 5 #include "extensions/shell/browser/shell_content_browser_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "components/guest_view/browser/guest_view_message_filter.h" | |
8 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
10 #include "content/public/browser/site_instance.h" | 11 #include "content/public/browser/site_instance.h" |
11 #include "content/public/common/content_descriptors.h" | 12 #include "content/public/common/content_descriptors.h" |
12 #include "content/public/common/content_switches.h" | 13 #include "content/public/common/content_switches.h" |
13 #include "content/public/common/url_constants.h" | 14 #include "content/public/common/url_constants.h" |
14 #include "content/shell/browser/shell_browser_context.h" | 15 #include "content/shell/browser/shell_browser_context.h" |
15 #include "content/shell/browser/shell_devtools_manager_delegate.h" | 16 #include "content/shell/browser/shell_devtools_manager_delegate.h" |
16 #include "extensions/browser/extension_message_filter.h" | 17 #include "extensions/browser/extension_message_filter.h" |
17 #include "extensions/browser/extension_protocols.h" | 18 #include "extensions/browser/extension_protocols.h" |
18 #include "extensions/browser/extension_registry.h" | 19 #include "extensions/browser/extension_registry.h" |
19 #include "extensions/browser/guest_view/guest_view_message_filter.h" | 20 #include "extensions/browser/guest_view/extensions_guest_view_message_filter.h" |
20 #include "extensions/browser/info_map.h" | 21 #include "extensions/browser/info_map.h" |
21 #include "extensions/browser/io_thread_extension_message_filter.h" | 22 #include "extensions/browser/io_thread_extension_message_filter.h" |
22 #include "extensions/browser/process_map.h" | 23 #include "extensions/browser/process_map.h" |
23 #include "extensions/common/constants.h" | 24 #include "extensions/common/constants.h" |
24 #include "extensions/common/extension.h" | 25 #include "extensions/common/extension.h" |
25 #include "extensions/common/switches.h" | 26 #include "extensions/common/switches.h" |
26 #include "extensions/shell/browser/shell_browser_context.h" | 27 #include "extensions/shell/browser/shell_browser_context.h" |
27 #include "extensions/shell/browser/shell_browser_main_parts.h" | 28 #include "extensions/shell/browser/shell_browser_main_parts.h" |
28 #include "extensions/shell/browser/shell_extension_system.h" | 29 #include "extensions/shell/browser/shell_extension_system.h" |
29 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" | 30 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 | 87 |
87 void ShellContentBrowserClient::RenderProcessWillLaunch( | 88 void ShellContentBrowserClient::RenderProcessWillLaunch( |
88 content::RenderProcessHost* host) { | 89 content::RenderProcessHost* host) { |
89 int render_process_id = host->GetID(); | 90 int render_process_id = host->GetID(); |
90 BrowserContext* browser_context = browser_main_parts_->browser_context(); | 91 BrowserContext* browser_context = browser_main_parts_->browser_context(); |
91 host->AddFilter( | 92 host->AddFilter( |
92 new ExtensionMessageFilter(render_process_id, browser_context)); | 93 new ExtensionMessageFilter(render_process_id, browser_context)); |
93 host->AddFilter( | 94 host->AddFilter( |
94 new IOThreadExtensionMessageFilter(render_process_id, browser_context)); | 95 new IOThreadExtensionMessageFilter(render_process_id, browser_context)); |
95 host->AddFilter( | 96 host->AddFilter( |
96 new GuestViewMessageFilter(render_process_id, browser_context)); | 97 new guestview::GuestViewMessageFilter( |
98 render_process_id, browser_context)); | |
99 host->AddFilter( | |
lazyboy
2015/04/30 19:31:07
Add this change to CL description
Fady Samuel
2015/04/30 23:26:04
Done.
| |
100 new ExtensionsGuestViewMessageFilter( | |
101 render_process_id, browser_context)); | |
97 // PluginInfoMessageFilter is not required because app_shell does not have | 102 // PluginInfoMessageFilter is not required because app_shell does not have |
98 // the concept of disabled plugins. | 103 // the concept of disabled plugins. |
99 #if !defined(DISABLE_NACL) | 104 #if !defined(DISABLE_NACL) |
100 host->AddFilter(new nacl::NaClHostMessageFilter( | 105 host->AddFilter(new nacl::NaClHostMessageFilter( |
101 render_process_id, | 106 render_process_id, |
102 browser_context->IsOffTheRecord(), | 107 browser_context->IsOffTheRecord(), |
103 browser_context->GetPath(), | 108 browser_context->GetPath(), |
104 browser_context->GetRequestContextForRenderProcess(render_process_id))); | 109 browser_context->GetRequestContextForRenderProcess(render_process_id))); |
105 #endif | 110 #endif |
106 } | 111 } |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 | 305 |
301 const Extension* ShellContentBrowserClient::GetExtension( | 306 const Extension* ShellContentBrowserClient::GetExtension( |
302 content::SiteInstance* site_instance) { | 307 content::SiteInstance* site_instance) { |
303 ExtensionRegistry* registry = | 308 ExtensionRegistry* registry = |
304 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 309 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
305 return registry->enabled_extensions().GetExtensionOrAppByURL( | 310 return registry->enabled_extensions().GetExtensionOrAppByURL( |
306 site_instance->GetSiteURL()); | 311 site_instance->GetSiteURL()); |
307 } | 312 } |
308 | 313 |
309 } // namespace extensions | 314 } // namespace extensions |
OLD | NEW |