| 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 "chrome/browser/extensions/chrome_content_browser_client_extensions_par
t.h" | 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par
t.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/common/chrome_constants.h" | 22 #include "chrome/common/chrome_constants.h" |
| 23 #include "chrome/common/extensions/extension_process_policy.h" | 23 #include "chrome/common/extensions/extension_process_policy.h" |
| 24 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" | 24 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" |
| 25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 26 #include "content/public/browser/browser_url_handler.h" | 26 #include "content/public/browser/browser_url_handler.h" |
| 27 #include "content/public/browser/render_process_host.h" | 27 #include "content/public/browser/render_process_host.h" |
| 28 #include "content/public/browser/render_view_host.h" | 28 #include "content/public/browser/render_view_host.h" |
| 29 #include "content/public/browser/site_instance.h" | 29 #include "content/public/browser/site_instance.h" |
| 30 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
| 31 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
| 32 #include "extensions/browser/api/web_request/web_request_api_helpers.h" |
| 32 #include "extensions/browser/extension_host.h" | 33 #include "extensions/browser/extension_host.h" |
| 33 #include "extensions/browser/extension_message_filter.h" | 34 #include "extensions/browser/extension_message_filter.h" |
| 34 #include "extensions/browser/extension_registry.h" | 35 #include "extensions/browser/extension_registry.h" |
| 35 #include "extensions/browser/extension_system.h" | 36 #include "extensions/browser/extension_system.h" |
| 36 #include "extensions/browser/info_map.h" | 37 #include "extensions/browser/info_map.h" |
| 37 #include "extensions/browser/view_type_utils.h" | 38 #include "extensions/browser/view_type_utils.h" |
| 38 #include "extensions/common/constants.h" | 39 #include "extensions/common/constants.h" |
| 39 #include "extensions/common/manifest_handlers/background_info.h" | 40 #include "extensions/common/manifest_handlers/background_info.h" |
| 40 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" | 41 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" |
| 41 #include "extensions/common/switches.h" | 42 #include "extensions/common/switches.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 site_instance->GetProcess()->GetID())); | 392 site_instance->GetProcess()->GetID())); |
| 392 } | 393 } |
| 393 | 394 |
| 394 void ChromeContentBrowserClientExtensionsPart::RenderProcessWillLaunch( | 395 void ChromeContentBrowserClientExtensionsPart::RenderProcessWillLaunch( |
| 395 content::RenderProcessHost* host) { | 396 content::RenderProcessHost* host) { |
| 396 int id = host->GetID(); | 397 int id = host->GetID(); |
| 397 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 398 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
| 398 | 399 |
| 399 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); | 400 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); |
| 400 host->AddFilter(new ExtensionMessageFilter(id, profile)); | 401 host->AddFilter(new ExtensionMessageFilter(id, profile)); |
| 401 SendExtensionWebRequestStatusToHost(host); | 402 extension_web_request_api_helpers::SendExtensionWebRequestStatusToHost(host); |
| 402 } | 403 } |
| 403 | 404 |
| 404 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess( | 405 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess( |
| 405 SiteInstance* site_instance) { | 406 SiteInstance* site_instance) { |
| 406 Profile* profile = Profile::FromBrowserContext( | 407 Profile* profile = Profile::FromBrowserContext( |
| 407 site_instance->GetProcess()->GetBrowserContext()); | 408 site_instance->GetProcess()->GetBrowserContext()); |
| 408 ExtensionService* service = | 409 ExtensionService* service = |
| 409 ExtensionSystem::Get(profile)->extension_service(); | 410 ExtensionSystem::Get(profile)->extension_service(); |
| 410 if (!service) | 411 if (!service) |
| 411 return; | 412 return; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 DCHECK(profile); | 529 DCHECK(profile); |
| 529 if (ProcessMap::Get(profile)->Contains(process->GetID())) { | 530 if (ProcessMap::Get(profile)->Contains(process->GetID())) { |
| 530 command_line->AppendSwitch(switches::kExtensionProcess); | 531 command_line->AppendSwitch(switches::kExtensionProcess); |
| 531 #if defined(ENABLE_WEBRTC) | 532 #if defined(ENABLE_WEBRTC) |
| 532 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); | 533 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); |
| 533 #endif | 534 #endif |
| 534 } | 535 } |
| 535 } | 536 } |
| 536 | 537 |
| 537 } // namespace extensions | 538 } // namespace extensions |
| OLD | NEW |