| 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 "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
| 10 #include "content/public/browser/site_instance.h" | 10 #include "content/public/browser/site_instance.h" |
| 11 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
| 12 #include "content/public/common/url_constants.h" | 12 #include "content/public/common/url_constants.h" |
| 13 #include "content/shell/browser/shell_browser_context.h" | 13 #include "content/shell/browser/shell_browser_context.h" |
| 14 #include "content/shell/browser/shell_devtools_manager_delegate.h" | 14 #include "content/shell/browser/shell_devtools_manager_delegate.h" |
| 15 #include "extensions/browser/extension_message_filter.h" | 15 #include "extensions/browser/extension_message_filter.h" |
| 16 #include "extensions/browser/extension_protocols.h" | 16 #include "extensions/browser/extension_protocols.h" |
| 17 #include "extensions/browser/extension_registry.h" | 17 #include "extensions/browser/extension_registry.h" |
| 18 #include "extensions/browser/guest_view/guest_view_message_filter.h" | 18 #include "extensions/browser/guest_view/guest_view_message_filter.h" |
| 19 #include "extensions/browser/info_map.h" | 19 #include "extensions/browser/info_map.h" |
| 20 #include "extensions/browser/io_thread_extension_message_filter.h" |
| 20 #include "extensions/browser/process_map.h" | 21 #include "extensions/browser/process_map.h" |
| 21 #include "extensions/common/constants.h" | 22 #include "extensions/common/constants.h" |
| 22 #include "extensions/common/extension.h" | 23 #include "extensions/common/extension.h" |
| 23 #include "extensions/common/switches.h" | 24 #include "extensions/common/switches.h" |
| 24 #include "extensions/shell/browser/shell_browser_context.h" | 25 #include "extensions/shell/browser/shell_browser_context.h" |
| 25 #include "extensions/shell/browser/shell_browser_main_parts.h" | 26 #include "extensions/shell/browser/shell_browser_main_parts.h" |
| 26 #include "extensions/shell/browser/shell_extension_system.h" | 27 #include "extensions/shell/browser/shell_extension_system.h" |
| 27 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" | 28 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" |
| 28 #include "url/gurl.h" | 29 #include "url/gurl.h" |
| 29 | 30 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 return browser_main_parts_; | 76 return browser_main_parts_; |
| 76 } | 77 } |
| 77 | 78 |
| 78 void ShellContentBrowserClient::RenderProcessWillLaunch( | 79 void ShellContentBrowserClient::RenderProcessWillLaunch( |
| 79 content::RenderProcessHost* host) { | 80 content::RenderProcessHost* host) { |
| 80 int render_process_id = host->GetID(); | 81 int render_process_id = host->GetID(); |
| 81 BrowserContext* browser_context = browser_main_parts_->browser_context(); | 82 BrowserContext* browser_context = browser_main_parts_->browser_context(); |
| 82 host->AddFilter( | 83 host->AddFilter( |
| 83 new ExtensionMessageFilter(render_process_id, browser_context)); | 84 new ExtensionMessageFilter(render_process_id, browser_context)); |
| 84 host->AddFilter( | 85 host->AddFilter( |
| 86 new IOThreadExtensionMessageFilter(render_process_id, browser_context)); |
| 87 host->AddFilter( |
| 85 new GuestViewMessageFilter(render_process_id, browser_context)); | 88 new GuestViewMessageFilter(render_process_id, browser_context)); |
| 86 // PluginInfoMessageFilter is not required because app_shell does not have | 89 // PluginInfoMessageFilter is not required because app_shell does not have |
| 87 // the concept of disabled plugins. | 90 // the concept of disabled plugins. |
| 88 #if !defined(DISABLE_NACL) | 91 #if !defined(DISABLE_NACL) |
| 89 host->AddFilter(new nacl::NaClHostMessageFilter( | 92 host->AddFilter(new nacl::NaClHostMessageFilter( |
| 90 render_process_id, | 93 render_process_id, |
| 91 browser_context->IsOffTheRecord(), | 94 browser_context->IsOffTheRecord(), |
| 92 browser_context->GetPath(), | 95 browser_context->GetPath(), |
| 93 browser_context->GetRequestContextForRenderProcess(render_process_id))); | 96 browser_context->GetRequestContextForRenderProcess(render_process_id))); |
| 94 #endif | 97 #endif |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 260 |
| 258 const Extension* ShellContentBrowserClient::GetExtension( | 261 const Extension* ShellContentBrowserClient::GetExtension( |
| 259 content::SiteInstance* site_instance) { | 262 content::SiteInstance* site_instance) { |
| 260 ExtensionRegistry* registry = | 263 ExtensionRegistry* registry = |
| 261 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 264 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
| 262 return registry->enabled_extensions().GetExtensionOrAppByURL( | 265 return registry->enabled_extensions().GetExtensionOrAppByURL( |
| 263 site_instance->GetSiteURL()); | 266 site_instance->GetSiteURL()); |
| 264 } | 267 } |
| 265 | 268 |
| 266 } // namespace extensions | 269 } // namespace extensions |
| OLD | NEW |