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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 #endif // defined(OS_WIN) | 178 #endif // defined(OS_WIN) |
179 | 179 |
180 } // namespace | 180 } // namespace |
181 | 181 |
182 namespace extensions { | 182 namespace extensions { |
183 | 183 |
184 ExtensionsHandler::ExtensionsHandler() { | 184 ExtensionsHandler::ExtensionsHandler() { |
185 ExtensionsClient::Set(ChromeExtensionsClient::GetInstance()); | 185 ExtensionsClient::Set(ChromeExtensionsClient::GetInstance()); |
186 } | 186 } |
187 | 187 |
188 ExtensionsHandler::~ExtensionsHandler() { | 188 ExtensionsHandler::~ExtensionsHandler() = default; |
189 } | |
190 | 189 |
191 // static | 190 // static |
192 void ExtensionsHandler::PreSandboxStartup() { | 191 void ExtensionsHandler::PreSandboxStartup() { |
193 // Initialize media libraries for media file validation. | 192 // Initialize media libraries for media file validation. |
194 media::InitializeMediaLibrary(); | 193 media::InitializeMediaLibrary(); |
195 } | 194 } |
196 | 195 |
197 // static | 196 // static |
197 void ExtensionsHandler::UtilityThreadStarted() { | |
198 UtilityHandler::UtilityThreadStarted(); | |
Devlin
2017/02/14 17:24:59
Why do we need this method, as opposed to calling
Noel Gordon
2017/02/15 17:28:08
ExtensionsHandler owns a UtilityHandler utility_ha
Devlin
2017/02/17 15:53:56
I don't quite follow - this is a static method, so
| |
199 } | |
200 | |
201 // static | |
198 void ExtensionsHandler::ExposeInterfacesToBrowser( | 202 void ExtensionsHandler::ExposeInterfacesToBrowser( |
199 service_manager::InterfaceRegistry* registry, | 203 service_manager::InterfaceRegistry* registry, |
200 ChromeContentUtilityClient* utility_client, | 204 ChromeContentUtilityClient* utility_client, |
201 bool running_elevated) { | 205 bool running_elevated) { |
206 UtilityHandler::ExposeInterfacesToBrowser(registry, running_elevated); | |
202 // If our process runs with elevated privileges, only add elevated Mojo | 207 // If our process runs with elevated privileges, only add elevated Mojo |
203 // services to the interface registry. | 208 // services to the interface registry. |
204 if (running_elevated) { | 209 if (running_elevated) { |
205 #if defined(OS_WIN) | 210 #if defined(OS_WIN) |
206 registry->AddInterface(base::Bind(&RemovableStorageWriterImpl::Create)); | 211 registry->AddInterface(base::Bind(&RemovableStorageWriterImpl::Create)); |
207 registry->AddInterface(base::Bind(&WiFiCredentialsGetterImpl::Create)); | 212 registry->AddInterface(base::Bind(&WiFiCredentialsGetterImpl::Create)); |
208 #endif | 213 #endif |
209 return; | 214 return; |
210 } | 215 } |
211 | 216 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
292 picasa::PicasaAlbumsIndexer indexer(album_uids); | 297 picasa::PicasaAlbumsIndexer indexer(album_uids); |
293 indexer.ParseFolderINI(folders_inis); | 298 indexer.ParseFolderINI(folders_inis); |
294 content::UtilityThread::Get()->Send( | 299 content::UtilityThread::Get()->Send( |
295 new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( | 300 new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( |
296 indexer.albums_images())); | 301 indexer.albums_images())); |
297 ReleaseProcessIfNeeded(); | 302 ReleaseProcessIfNeeded(); |
298 } | 303 } |
299 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 304 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
300 | 305 |
301 } // namespace extensions | 306 } // namespace extensions |
OLD | NEW |