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/info_map.h" | 19 #include "extensions/browser/info_map.h" |
19 #include "extensions/browser/process_map.h" | 20 #include "extensions/browser/process_map.h" |
20 #include "extensions/common/constants.h" | 21 #include "extensions/common/constants.h" |
21 #include "extensions/common/extension.h" | 22 #include "extensions/common/extension.h" |
22 #include "extensions/common/switches.h" | 23 #include "extensions/common/switches.h" |
23 #include "extensions/shell/browser/shell_browser_context.h" | 24 #include "extensions/shell/browser/shell_browser_context.h" |
24 #include "extensions/shell/browser/shell_browser_main_parts.h" | 25 #include "extensions/shell/browser/shell_browser_main_parts.h" |
25 #include "extensions/shell/browser/shell_extension_system.h" | 26 #include "extensions/shell/browser/shell_extension_system.h" |
26 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" | 27 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" |
27 #include "url/gurl.h" | 28 #include "url/gurl.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 CreateShellBrowserMainParts(parameters, browser_main_delegate_); | 74 CreateShellBrowserMainParts(parameters, browser_main_delegate_); |
74 return browser_main_parts_; | 75 return browser_main_parts_; |
75 } | 76 } |
76 | 77 |
77 void ShellContentBrowserClient::RenderProcessWillLaunch( | 78 void ShellContentBrowserClient::RenderProcessWillLaunch( |
78 content::RenderProcessHost* host) { | 79 content::RenderProcessHost* host) { |
79 int render_process_id = host->GetID(); | 80 int render_process_id = host->GetID(); |
80 BrowserContext* browser_context = browser_main_parts_->browser_context(); | 81 BrowserContext* browser_context = browser_main_parts_->browser_context(); |
81 host->AddFilter( | 82 host->AddFilter( |
82 new ExtensionMessageFilter(render_process_id, browser_context)); | 83 new ExtensionMessageFilter(render_process_id, browser_context)); |
| 84 host->AddFilter( |
| 85 new GuestViewMessageFilter(render_process_id, browser_context)); |
83 // PluginInfoMessageFilter is not required because app_shell does not have | 86 // PluginInfoMessageFilter is not required because app_shell does not have |
84 // the concept of disabled plugins. | 87 // the concept of disabled plugins. |
85 #if !defined(DISABLE_NACL) | 88 #if !defined(DISABLE_NACL) |
86 host->AddFilter(new nacl::NaClHostMessageFilter( | 89 host->AddFilter(new nacl::NaClHostMessageFilter( |
87 render_process_id, | 90 render_process_id, |
88 browser_context->IsOffTheRecord(), | 91 browser_context->IsOffTheRecord(), |
89 browser_context->GetPath(), | 92 browser_context->GetPath(), |
90 browser_context->GetRequestContextForRenderProcess(render_process_id))); | 93 browser_context->GetRequestContextForRenderProcess(render_process_id))); |
91 #endif | 94 #endif |
92 } | 95 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 257 |
255 const Extension* ShellContentBrowserClient::GetExtension( | 258 const Extension* ShellContentBrowserClient::GetExtension( |
256 content::SiteInstance* site_instance) { | 259 content::SiteInstance* site_instance) { |
257 ExtensionRegistry* registry = | 260 ExtensionRegistry* registry = |
258 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 261 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
259 return registry->enabled_extensions().GetExtensionOrAppByURL( | 262 return registry->enabled_extensions().GetExtensionOrAppByURL( |
260 site_instance->GetSiteURL()); | 263 site_instance->GetSiteURL()); |
261 } | 264 } |
262 | 265 |
263 } // namespace extensions | 266 } // namespace extensions |
OLD | NEW |