| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/utility/chrome_content_utility_client.h" | 5 #include "chrome/utility/chrome_content_utility_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 void ChromeContentUtilityClient::ExposeInterfacesToBrowser( | 193 void ChromeContentUtilityClient::ExposeInterfacesToBrowser( |
| 194 service_manager::InterfaceRegistry* registry) { | 194 service_manager::InterfaceRegistry* registry) { |
| 195 const bool running_elevated = | 195 const bool running_elevated = |
| 196 base::CommandLine::ForCurrentProcess()->HasSwitch( | 196 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 197 switches::kUtilityProcessRunningElevated); | 197 switches::kUtilityProcessRunningElevated); |
| 198 #if BUILDFLAG(ENABLE_EXTENSIONS) | 198 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 199 ChromeContentUtilityClient* utility_client = this; | 199 ChromeContentUtilityClient* utility_client = this; |
| 200 extensions::ExtensionsHandler::ExposeInterfacesToBrowser( | 200 extensions::ExtensionsHandler::ExposeInterfacesToBrowser( |
| 201 registry, utility_client, running_elevated); | 201 registry, utility_client, running_elevated); |
| 202 #endif | 202 #endif |
| 203 // If our process runs with elevated privileges, only add elevated | 203 // If our process runs with elevated privileges, only add elevated Mojo |
| 204 // Mojo services to the interface registry. | 204 // services to the interface registry. |
| 205 if (running_elevated) | 205 if (running_elevated) |
| 206 return; | 206 return; |
| 207 | 207 |
| 208 #if !defined(OS_ANDROID) | 208 #if !defined(OS_ANDROID) |
| 209 registry->AddInterface<net::interfaces::ProxyResolverFactory>( | 209 registry->AddInterface<net::interfaces::ProxyResolverFactory>( |
| 210 base::Bind(CreateProxyResolverFactory)); | 210 base::Bind(CreateProxyResolverFactory)); |
| 211 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); | 211 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); |
| 212 registry->AddInterface(base::Bind(&ProfileImportHandler::Create)); | 212 registry->AddInterface(base::Bind(&ProfileImportHandler::Create)); |
| 213 #endif | 213 #endif |
| 214 registry->AddInterface( | 214 registry->AddInterface( |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 safe_browsing::zip_analyzer::Results results; | 312 safe_browsing::zip_analyzer::Results results; |
| 313 safe_browsing::dmg::AnalyzeDMGFile( | 313 safe_browsing::dmg::AnalyzeDMGFile( |
| 314 IPC::PlatformFileForTransitToFile(dmg_file), &results); | 314 IPC::PlatformFileForTransitToFile(dmg_file), &results); |
| 315 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( | 315 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( |
| 316 results)); | 316 results)); |
| 317 ReleaseProcessIfNeeded(); | 317 ReleaseProcessIfNeeded(); |
| 318 } | 318 } |
| 319 #endif // defined(OS_MACOSX) | 319 #endif // defined(OS_MACOSX) |
| 320 | 320 |
| 321 #endif // defined(FULL_SAFE_BROWSING) | 321 #endif // defined(FULL_SAFE_BROWSING) |
| OLD | NEW |