| 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 25 matching lines...) Expand all Loading... |
| 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 "storage/browser/quota/quota_settings.h" | 41 #include "storage/browser/quota/quota_settings.h" |
| 42 #include "url/gurl.h" | 42 #include "url/gurl.h" |
| 43 | 43 |
| 44 #if !defined(DISABLE_NACL) | 44 #if !defined(DISABLE_NACL) |
| 45 #include "components/nacl/browser/nacl_browser.h" | 45 #include "components/nacl/browser/nacl_browser.h" |
| 46 #include "components/nacl/browser/nacl_host_message_filter.h" | |
| 47 #include "components/nacl/browser/nacl_process_host.h" | 46 #include "components/nacl/browser/nacl_process_host.h" |
| 48 #include "components/nacl/common/nacl_process_type.h" | 47 #include "components/nacl/common/nacl_process_type.h" |
| 49 #include "components/nacl/common/nacl_switches.h" | 48 #include "components/nacl/common/nacl_switches.h" |
| 50 #include "content/public/browser/browser_child_process_host.h" | 49 #include "content/public/browser/browser_child_process_host.h" |
| 51 #include "content/public/browser/child_process_data.h" | 50 #include "content/public/browser/child_process_data.h" |
| 52 #endif | 51 #endif |
| 53 | 52 |
| 54 using base::CommandLine; | 53 using base::CommandLine; |
| 55 using content::BrowserContext; | 54 using content::BrowserContext; |
| 56 using content::BrowserThread; | 55 using content::BrowserThread; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 BrowserContext* browser_context = browser_main_parts_->browser_context(); | 95 BrowserContext* browser_context = browser_main_parts_->browser_context(); |
| 97 host->AddFilter( | 96 host->AddFilter( |
| 98 new ExtensionMessageFilter(render_process_id, browser_context)); | 97 new ExtensionMessageFilter(render_process_id, browser_context)); |
| 99 host->AddFilter( | 98 host->AddFilter( |
| 100 new IOThreadExtensionMessageFilter(render_process_id, browser_context)); | 99 new IOThreadExtensionMessageFilter(render_process_id, browser_context)); |
| 101 host->AddFilter( | 100 host->AddFilter( |
| 102 new ExtensionsGuestViewMessageFilter( | 101 new ExtensionsGuestViewMessageFilter( |
| 103 render_process_id, browser_context)); | 102 render_process_id, browser_context)); |
| 104 // PluginInfoMessageFilter is not required because app_shell does not have | 103 // PluginInfoMessageFilter is not required because app_shell does not have |
| 105 // the concept of disabled plugins. | 104 // the concept of disabled plugins. |
| 106 #if !defined(DISABLE_NACL) | |
| 107 host->AddFilter(new nacl::NaClHostMessageFilter( | |
| 108 render_process_id, | |
| 109 browser_context->IsOffTheRecord(), | |
| 110 browser_context->GetPath(), | |
| 111 host->GetStoragePartition()->GetURLRequestContext())); | |
| 112 #endif | |
| 113 } | 105 } |
| 114 | 106 |
| 115 bool ShellContentBrowserClient::ShouldUseProcessPerSite( | 107 bool ShellContentBrowserClient::ShouldUseProcessPerSite( |
| 116 content::BrowserContext* browser_context, | 108 content::BrowserContext* browser_context, |
| 117 const GURL& effective_url) { | 109 const GURL& effective_url) { |
| 118 // This ensures that all render views created for a single app will use the | 110 // This ensures that all render views created for a single app will use the |
| 119 // same render process (see content::SiteInstance::GetProcess). Otherwise the | 111 // same render process (see content::SiteInstance::GetProcess). Otherwise the |
| 120 // default behavior of ContentBrowserClient will lead to separate render | 112 // default behavior of ContentBrowserClient will lead to separate render |
| 121 // processes for the background page and each app window view. | 113 // processes for the background page and each app window view. |
| 122 return true; | 114 return true; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 276 |
| 285 const Extension* ShellContentBrowserClient::GetExtension( | 277 const Extension* ShellContentBrowserClient::GetExtension( |
| 286 content::SiteInstance* site_instance) { | 278 content::SiteInstance* site_instance) { |
| 287 ExtensionRegistry* registry = | 279 ExtensionRegistry* registry = |
| 288 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 280 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
| 289 return registry->enabled_extensions().GetExtensionOrAppByURL( | 281 return registry->enabled_extensions().GetExtensionOrAppByURL( |
| 290 site_instance->GetSiteURL()); | 282 site_instance->GetSiteURL()); |
| 291 } | 283 } |
| 292 | 284 |
| 293 } // namespace extensions | 285 } // namespace extensions |
| OLD | NEW |