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/browser/extensions/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 base::FilePath filemgr_extension_path( | 247 base::FilePath filemgr_extension_path( |
248 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); | 248 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); |
249 Add(manifest_id, filemgr_extension_path); | 249 Add(manifest_id, filemgr_extension_path); |
250 return; | 250 return; |
251 } | 251 } |
252 #endif // NDEBUG | 252 #endif // NDEBUG |
253 Add(manifest_id, base::FilePath(FILE_PATH_LITERAL("file_manager"))); | 253 Add(manifest_id, base::FilePath(FILE_PATH_LITERAL("file_manager"))); |
254 #endif // defined(FILE_MANAGER_EXTENSION) | 254 #endif // defined(FILE_MANAGER_EXTENSION) |
255 } | 255 } |
256 | 256 |
| 257 void ComponentLoader::AddImageLoaderExtension() { |
| 258 #if defined(IMAGE_LOADER_EXTENSION) |
| 259 #ifndef NDEBUG |
| 260 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 261 if (command_line->HasSwitch(switches::kImageLoaderExtensionPath)) { |
| 262 base::FilePath image_loader_extension_path( |
| 263 command_line->GetSwitchValuePath(switches::kImageLoaderExtensionPath)); |
| 264 Add(IDR_IMAGE_LOADER_MANIFEST, image_loader_extension_path); |
| 265 return; |
| 266 } |
| 267 #endif // NDEBUG |
| 268 Add(IDR_IMAGE_LOADER_MANIFEST, |
| 269 base::FilePath(FILE_PATH_LITERAL("image_loader"))); |
| 270 #endif // defined(IMAGE_LOADER_EXTENSION) |
| 271 } |
| 272 |
257 #if defined(OS_CHROMEOS) | 273 #if defined(OS_CHROMEOS) |
258 void ComponentLoader::AddGaiaAuthExtension() { | 274 void ComponentLoader::AddGaiaAuthExtension() { |
259 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 275 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
260 if (command_line->HasSwitch(switches::kAuthExtensionPath)) { | 276 if (command_line->HasSwitch(switches::kAuthExtensionPath)) { |
261 base::FilePath auth_extension_path = | 277 base::FilePath auth_extension_path = |
262 command_line->GetSwitchValuePath(switches::kAuthExtensionPath); | 278 command_line->GetSwitchValuePath(switches::kAuthExtensionPath); |
263 Add(IDR_GAIA_TEST_AUTH_MANIFEST, auth_extension_path); | 279 Add(IDR_GAIA_TEST_AUTH_MANIFEST, auth_extension_path); |
264 return; | 280 return; |
265 } | 281 } |
266 Add(IDR_GAIA_AUTH_MANIFEST, base::FilePath(FILE_PATH_LITERAL("gaia_auth"))); | 282 Add(IDR_GAIA_AUTH_MANIFEST, base::FilePath(FILE_PATH_LITERAL("gaia_auth"))); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 399 |
384 if (!skip_session_components) { | 400 if (!skip_session_components) { |
385 // Apps Debugger | 401 // Apps Debugger |
386 if (CommandLine::ForCurrentProcess()->HasSwitch( | 402 if (CommandLine::ForCurrentProcess()->HasSwitch( |
387 switches::kAppsDevtool)) { | 403 switches::kAppsDevtool)) { |
388 Add(IDR_APPS_DEBUGGER_MANIFEST, | 404 Add(IDR_APPS_DEBUGGER_MANIFEST, |
389 base::FilePath(FILE_PATH_LITERAL("apps_debugger"))); | 405 base::FilePath(FILE_PATH_LITERAL("apps_debugger"))); |
390 } | 406 } |
391 | 407 |
392 AddFileManagerExtension(); | 408 AddFileManagerExtension(); |
| 409 AddImageLoaderExtension(); |
393 | 410 |
394 #if defined(ENABLE_SETTINGS_APP) | 411 #if defined(ENABLE_SETTINGS_APP) |
395 Add(IDR_SETTINGS_APP_MANIFEST, | 412 Add(IDR_SETTINGS_APP_MANIFEST, |
396 base::FilePath(FILE_PATH_LITERAL("settings_app"))); | 413 base::FilePath(FILE_PATH_LITERAL("settings_app"))); |
397 #endif | 414 #endif |
398 } | 415 } |
399 | 416 |
400 #if defined(OS_CHROMEOS) | 417 #if defined(OS_CHROMEOS) |
401 if (!skip_session_components) { | 418 if (!skip_session_components) { |
402 Add(IDR_WALLPAPERMANAGER_MANIFEST, | 419 Add(IDR_WALLPAPERMANAGER_MANIFEST, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 void ComponentLoader::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 458 void ComponentLoader::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
442 registry->RegisterStringPref(prefs::kEnterpriseWebStoreURL, | 459 registry->RegisterStringPref(prefs::kEnterpriseWebStoreURL, |
443 std::string() /* default_value */, | 460 std::string() /* default_value */, |
444 PrefRegistrySyncable::UNSYNCABLE_PREF); | 461 PrefRegistrySyncable::UNSYNCABLE_PREF); |
445 registry->RegisterStringPref(prefs::kEnterpriseWebStoreName, | 462 registry->RegisterStringPref(prefs::kEnterpriseWebStoreName, |
446 std::string() /* default_value */, | 463 std::string() /* default_value */, |
447 PrefRegistrySyncable::UNSYNCABLE_PREF); | 464 PrefRegistrySyncable::UNSYNCABLE_PREF); |
448 } | 465 } |
449 | 466 |
450 } // namespace extensions | 467 } // namespace extensions |
OLD | NEW |