| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 93 |
| 93 void ShellContentBrowserClient::RenderProcessWillLaunch( | 94 void ShellContentBrowserClient::RenderProcessWillLaunch( |
| 94 content::RenderProcessHost* host) { | 95 content::RenderProcessHost* host) { |
| 95 int render_process_id = host->GetID(); | 96 int render_process_id = host->GetID(); |
| 96 BrowserContext* browser_context = browser_main_parts_->browser_context(); | 97 BrowserContext* browser_context = browser_main_parts_->browser_context(); |
| 97 host->AddFilter( | 98 host->AddFilter( |
| 98 new ExtensionMessageFilter(render_process_id, browser_context)); | 99 new ExtensionMessageFilter(render_process_id, browser_context)); |
| 99 host->AddFilter( | 100 host->AddFilter( |
| 100 new IOThreadExtensionMessageFilter(render_process_id, browser_context)); | 101 new IOThreadExtensionMessageFilter(render_process_id, browser_context)); |
| 101 host->AddFilter( | 102 host->AddFilter( |
| 102 new GuestViewMessageFilter(render_process_id, browser_context)); | 103 new guest_view::GuestViewMessageFilter( |
| 104 render_process_id, browser_context)); |
| 105 host->AddFilter( |
| 106 new ExtensionsGuestViewMessageFilter( |
| 107 render_process_id, browser_context)); |
| 103 // PluginInfoMessageFilter is not required because app_shell does not have | 108 // PluginInfoMessageFilter is not required because app_shell does not have |
| 104 // the concept of disabled plugins. | 109 // the concept of disabled plugins. |
| 105 #if !defined(DISABLE_NACL) | 110 #if !defined(DISABLE_NACL) |
| 106 host->AddFilter(new nacl::NaClHostMessageFilter( | 111 host->AddFilter(new nacl::NaClHostMessageFilter( |
| 107 render_process_id, | 112 render_process_id, |
| 108 browser_context->IsOffTheRecord(), | 113 browser_context->IsOffTheRecord(), |
| 109 browser_context->GetPath(), | 114 browser_context->GetPath(), |
| 110 browser_context->GetRequestContextForRenderProcess(render_process_id))); | 115 browser_context->GetRequestContextForRenderProcess(render_process_id))); |
| 111 #endif | 116 #endif |
| 112 } | 117 } |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 341 |
| 337 const Extension* ShellContentBrowserClient::GetExtension( | 342 const Extension* ShellContentBrowserClient::GetExtension( |
| 338 content::SiteInstance* site_instance) { | 343 content::SiteInstance* site_instance) { |
| 339 ExtensionRegistry* registry = | 344 ExtensionRegistry* registry = |
| 340 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 345 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
| 341 return registry->enabled_extensions().GetExtensionOrAppByURL( | 346 return registry->enabled_extensions().GetExtensionOrAppByURL( |
| 342 site_instance->GetSiteURL()); | 347 site_instance->GetSiteURL()); |
| 343 } | 348 } |
| 344 | 349 |
| 345 } // namespace extensions | 350 } // namespace extensions |
| OLD | NEW |