| 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/utility/extensions/extensions_handler.h" | 5 #include "chrome/utility/extensions/extensions_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 #endif // defined(OS_WIN) | 169 #endif // defined(OS_WIN) |
| 170 | 170 |
| 171 } // namespace | 171 } // namespace |
| 172 | 172 |
| 173 namespace extensions { | 173 namespace extensions { |
| 174 | 174 |
| 175 ExtensionsHandler::ExtensionsHandler() { | 175 ExtensionsHandler::ExtensionsHandler() { |
| 176 ExtensionsClient::Set(ChromeExtensionsClient::GetInstance()); | 176 ExtensionsClient::Set(ChromeExtensionsClient::GetInstance()); |
| 177 } | 177 } |
| 178 | 178 |
| 179 ExtensionsHandler::~ExtensionsHandler() { | 179 ExtensionsHandler::~ExtensionsHandler() = default; |
| 180 } | |
| 181 | 180 |
| 182 // static | 181 // static |
| 183 void ExtensionsHandler::PreSandboxStartup() { | 182 void ExtensionsHandler::PreSandboxStartup() { |
| 184 // Initialize media libraries for media file validation. | 183 // Initialize media libraries for media file validation. |
| 185 media::InitializeMediaLibrary(); | 184 media::InitializeMediaLibrary(); |
| 186 } | 185 } |
| 187 | 186 |
| 188 // static | 187 // static |
| 188 void ExtensionsHandler::UtilityThreadStarted() { |
| 189 UtilityHandler::UtilityThreadStarted(); |
| 190 } |
| 191 |
| 192 // static |
| 189 void ExtensionsHandler::ExposeInterfacesToBrowser( | 193 void ExtensionsHandler::ExposeInterfacesToBrowser( |
| 190 service_manager::InterfaceRegistry* registry, | 194 service_manager::InterfaceRegistry* registry, |
| 191 bool running_elevated) { | 195 bool running_elevated) { |
| 196 UtilityHandler::ExposeInterfacesToBrowser(registry, running_elevated); |
| 192 // If our process runs with elevated privileges, only add elevated Mojo | 197 // If our process runs with elevated privileges, only add elevated Mojo |
| 193 // services to the interface registry. | 198 // services to the interface registry. |
| 194 if (running_elevated) { | 199 if (running_elevated) { |
| 195 #if defined(OS_WIN) | 200 #if defined(OS_WIN) |
| 196 registry->AddInterface(base::Bind(&RemovableStorageWriterImpl::Create)); | 201 registry->AddInterface(base::Bind(&RemovableStorageWriterImpl::Create)); |
| 197 registry->AddInterface(base::Bind(&WiFiCredentialsGetterImpl::Create)); | 202 registry->AddInterface(base::Bind(&WiFiCredentialsGetterImpl::Create)); |
| 198 #endif | 203 #endif |
| 199 return; | 204 return; |
| 200 } | 205 } |
| 201 | 206 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 picasa::PicasaAlbumsIndexer indexer(album_uids); | 287 picasa::PicasaAlbumsIndexer indexer(album_uids); |
| 283 indexer.ParseFolderINI(folders_inis); | 288 indexer.ParseFolderINI(folders_inis); |
| 284 content::UtilityThread::Get()->Send( | 289 content::UtilityThread::Get()->Send( |
| 285 new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( | 290 new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( |
| 286 indexer.albums_images())); | 291 indexer.albums_images())); |
| 287 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); | 292 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); |
| 288 } | 293 } |
| 289 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 294 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 290 | 295 |
| 291 } // namespace extensions | 296 } // namespace extensions |
| OLD | NEW |