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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "extensions/common/switches.h" | 35 #include "extensions/common/switches.h" |
36 #include "extensions/shell/browser/shell_browser_context.h" | 36 #include "extensions/shell/browser/shell_browser_context.h" |
37 #include "extensions/shell/browser/shell_browser_main_parts.h" | 37 #include "extensions/shell/browser/shell_browser_main_parts.h" |
38 #include "extensions/shell/browser/shell_extension_system.h" | 38 #include "extensions/shell/browser/shell_extension_system.h" |
39 #include "extensions/shell/browser/shell_navigation_ui_data.h" | 39 #include "extensions/shell/browser/shell_navigation_ui_data.h" |
40 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" | 40 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" |
41 #include "url/gurl.h" | 41 #include "url/gurl.h" |
42 | 42 |
43 #if !defined(DISABLE_NACL) | 43 #if !defined(DISABLE_NACL) |
44 #include "components/nacl/browser/nacl_browser.h" | 44 #include "components/nacl/browser/nacl_browser.h" |
45 #include "components/nacl/browser/nacl_host_message_filter.h" | |
46 #include "components/nacl/browser/nacl_process_host.h" | 45 #include "components/nacl/browser/nacl_process_host.h" |
47 #include "components/nacl/common/nacl_process_type.h" | 46 #include "components/nacl/common/nacl_process_type.h" |
48 #include "components/nacl/common/nacl_switches.h" | 47 #include "components/nacl/common/nacl_switches.h" |
49 #include "content/public/browser/browser_child_process_host.h" | 48 #include "content/public/browser/browser_child_process_host.h" |
50 #include "content/public/browser/child_process_data.h" | 49 #include "content/public/browser/child_process_data.h" |
51 #endif | 50 #endif |
52 | 51 |
53 using base::CommandLine; | 52 using base::CommandLine; |
54 using content::BrowserContext; | 53 using content::BrowserContext; |
55 using content::BrowserThread; | 54 using content::BrowserThread; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 BrowserContext* browser_context = browser_main_parts_->browser_context(); | 94 BrowserContext* browser_context = browser_main_parts_->browser_context(); |
96 host->AddFilter( | 95 host->AddFilter( |
97 new ExtensionMessageFilter(render_process_id, browser_context)); | 96 new ExtensionMessageFilter(render_process_id, browser_context)); |
98 host->AddFilter( | 97 host->AddFilter( |
99 new IOThreadExtensionMessageFilter(render_process_id, browser_context)); | 98 new IOThreadExtensionMessageFilter(render_process_id, browser_context)); |
100 host->AddFilter( | 99 host->AddFilter( |
101 new ExtensionsGuestViewMessageFilter( | 100 new ExtensionsGuestViewMessageFilter( |
102 render_process_id, browser_context)); | 101 render_process_id, browser_context)); |
103 // PluginInfoMessageFilter is not required because app_shell does not have | 102 // PluginInfoMessageFilter is not required because app_shell does not have |
104 // the concept of disabled plugins. | 103 // the concept of disabled plugins. |
105 #if !defined(DISABLE_NACL) | |
106 host->AddFilter(new nacl::NaClHostMessageFilter( | |
107 render_process_id, | |
108 browser_context->IsOffTheRecord(), | |
109 browser_context->GetPath(), | |
110 host->GetStoragePartition()->GetURLRequestContext())); | |
111 #endif | |
112 } | 104 } |
113 | 105 |
114 bool ShellContentBrowserClient::ShouldUseProcessPerSite( | 106 bool ShellContentBrowserClient::ShouldUseProcessPerSite( |
115 content::BrowserContext* browser_context, | 107 content::BrowserContext* browser_context, |
116 const GURL& effective_url) { | 108 const GURL& effective_url) { |
117 // This ensures that all render views created for a single app will use the | 109 // This ensures that all render views created for a single app will use the |
118 // same render process (see content::SiteInstance::GetProcess). Otherwise the | 110 // same render process (see content::SiteInstance::GetProcess). Otherwise the |
119 // default behavior of ContentBrowserClient will lead to separate render | 111 // default behavior of ContentBrowserClient will lead to separate render |
120 // processes for the background page and each app window view. | 112 // processes for the background page and each app window view. |
121 return true; | 113 return true; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 264 |
273 const Extension* ShellContentBrowserClient::GetExtension( | 265 const Extension* ShellContentBrowserClient::GetExtension( |
274 content::SiteInstance* site_instance) { | 266 content::SiteInstance* site_instance) { |
275 ExtensionRegistry* registry = | 267 ExtensionRegistry* registry = |
276 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 268 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
277 return registry->enabled_extensions().GetExtensionOrAppByURL( | 269 return registry->enabled_extensions().GetExtensionOrAppByURL( |
278 site_instance->GetSiteURL()); | 270 site_instance->GetSiteURL()); |
279 } | 271 } |
280 | 272 |
281 } // namespace extensions | 273 } // namespace extensions |
OLD | NEW |