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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 for (; it != component_extensions_.end(); ++it) | 243 for (; it != component_extensions_.end(); ++it) |
244 if (it->extension_id == id) | 244 if (it->extension_id == id) |
245 return true; | 245 return true; |
246 return false; | 246 return false; |
247 } | 247 } |
248 | 248 |
249 void ComponentLoader::AddFileManagerExtension() { | 249 void ComponentLoader::AddFileManagerExtension() { |
250 #if defined(FILE_MANAGER_EXTENSION) | 250 #if defined(FILE_MANAGER_EXTENSION) |
251 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 251 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
252 int manifest_id; | 252 int manifest_id; |
253 if (command_line->HasSwitch(switches::kFileManagerLegacy)) | 253 if (command_line->HasSwitch(chromeos::switches::kFileManagerLegacy)) |
254 manifest_id = IDR_FILEMANAGER_MANIFEST_V1; | 254 manifest_id = IDR_FILEMANAGER_MANIFEST_V1; |
255 else if (command_line->HasSwitch(switches::kFileManagerLegacyUI)) | 255 else if (command_line->HasSwitch(chromeos::switches::kFileManagerLegacyUI)) |
256 manifest_id = IDR_FILEMANAGER_MANIFEST; | 256 manifest_id = IDR_FILEMANAGER_MANIFEST; |
257 else | 257 else |
258 manifest_id = IDR_FILEMANAGER_MANIFEST_NEW_UI; | 258 manifest_id = IDR_FILEMANAGER_MANIFEST_NEW_UI; |
259 #ifndef NDEBUG | 259 #ifndef NDEBUG |
260 if (command_line->HasSwitch(switches::kFileManagerExtensionPath)) { | 260 if (command_line->HasSwitch(switches::kFileManagerExtensionPath)) { |
261 base::FilePath filemgr_extension_path( | 261 base::FilePath filemgr_extension_path( |
262 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); | 262 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); |
263 Add(manifest_id, filemgr_extension_path); | 263 Add(manifest_id, filemgr_extension_path); |
264 return; | 264 return; |
265 } | 265 } |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 GetFileSystemContext(); | 442 GetFileSystemContext(); |
443 fileapi::SandboxMountPointProvider* provider = | 443 fileapi::SandboxMountPointProvider* provider = |
444 context->sandbox_provider(); | 444 context->sandbox_provider(); |
445 provider->set_enable_temporary_file_system_in_incognito(true); | 445 provider->set_enable_temporary_file_system_in_incognito(true); |
446 } | 446 } |
447 } | 447 } |
448 #endif // defined(GOOGLE_CHROME_BUILD) | 448 #endif // defined(GOOGLE_CHROME_BUILD) |
449 | 449 |
450 base::FilePath echo_extension_path(FILE_PATH_LITERAL( | 450 base::FilePath echo_extension_path(FILE_PATH_LITERAL( |
451 "/usr/share/chromeos-assets/echo")); | 451 "/usr/share/chromeos-assets/echo")); |
452 if (command_line->HasSwitch(switches::kEchoExtensionPath)) { | 452 if (command_line->HasSwitch(chromeos::switches::kEchoExtensionPath)) { |
453 echo_extension_path = | 453 echo_extension_path = command_line->GetSwitchValuePath( |
454 command_line->GetSwitchValuePath(switches::kEchoExtensionPath); | 454 chromeos::switches::kEchoExtensionPath); |
455 } | 455 } |
456 Add(IDR_ECHO_MANIFEST, echo_extension_path); | 456 Add(IDR_ECHO_MANIFEST, echo_extension_path); |
457 | 457 |
458 Add(IDR_NETWORK_CONFIGURATION_MANIFEST, | 458 Add(IDR_NETWORK_CONFIGURATION_MANIFEST, |
459 base::FilePath(FILE_PATH_LITERAL("chromeos/network_configuration"))); | 459 base::FilePath(FILE_PATH_LITERAL("chromeos/network_configuration"))); |
460 } | 460 } |
461 | 461 |
462 // Load ChromeVox extension now if spoken feedback is enabled. | 462 // Load ChromeVox extension now if spoken feedback is enabled. |
463 if (local_state_->GetBoolean(prefs::kSpokenFeedbackEnabled)) { | 463 if (local_state_->GetBoolean(prefs::kSpokenFeedbackEnabled)) { |
464 base::FilePath path = | 464 base::FilePath path = |
(...skipping 27 matching lines...) Expand all Loading... |
492 prefs::kEnterpriseWebStoreURL, | 492 prefs::kEnterpriseWebStoreURL, |
493 std::string() /* default_value */, | 493 std::string() /* default_value */, |
494 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 494 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
495 registry->RegisterStringPref( | 495 registry->RegisterStringPref( |
496 prefs::kEnterpriseWebStoreName, | 496 prefs::kEnterpriseWebStoreName, |
497 std::string() /* default_value */, | 497 std::string() /* default_value */, |
498 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 498 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
499 } | 499 } |
500 | 500 |
501 } // namespace extensions | 501 } // namespace extensions |
OLD | NEW |