| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 component_extensions_.begin(); | 232 component_extensions_.begin(); |
| 233 for (; it != component_extensions_.end(); ++it) | 233 for (; it != component_extensions_.end(); ++it) |
| 234 if (it->extension_id == id) | 234 if (it->extension_id == id) |
| 235 return true; | 235 return true; |
| 236 return false; | 236 return false; |
| 237 } | 237 } |
| 238 | 238 |
| 239 void ComponentLoader::AddFileManagerExtension() { | 239 void ComponentLoader::AddFileManagerExtension() { |
| 240 #if defined(FILE_MANAGER_EXTENSION) | 240 #if defined(FILE_MANAGER_EXTENSION) |
| 241 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 241 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 242 int manifest_id = command_line->HasSwitch(switches::kFileManagerPackaged) ? | 242 int manifest_id; |
| 243 IDR_FILEMANAGER_MANIFEST : | 243 if (command_line->HasSwitch(switches::kFileManagerPackaged)) |
| 244 IDR_FILEMANAGER_MANIFEST_V1; | 244 manifest_id = IDR_FILEMANAGER_MANIFEST; |
| 245 else if (command_line->HasSwitch(switches::kFileManagerNewUI)) |
| 246 manifest_id = IDR_FILEMANAGER_MANIFEST_NEW_UI; |
| 247 else |
| 248 manifest_id = IDR_FILEMANAGER_MANIFEST_V1; |
| 245 #ifndef NDEBUG | 249 #ifndef NDEBUG |
| 246 if (command_line->HasSwitch(switches::kFileManagerExtensionPath)) { | 250 if (command_line->HasSwitch(switches::kFileManagerExtensionPath)) { |
| 247 base::FilePath filemgr_extension_path( | 251 base::FilePath filemgr_extension_path( |
| 248 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); | 252 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); |
| 249 Add(manifest_id, filemgr_extension_path); | 253 Add(manifest_id, filemgr_extension_path); |
| 250 return; | 254 return; |
| 251 } | 255 } |
| 252 #endif // NDEBUG | 256 #endif // NDEBUG |
| 253 Add(manifest_id, base::FilePath(FILE_PATH_LITERAL("file_manager"))); | 257 Add(manifest_id, base::FilePath(FILE_PATH_LITERAL("file_manager"))); |
| 254 #endif // defined(FILE_MANAGER_EXTENSION) | 258 #endif // defined(FILE_MANAGER_EXTENSION) |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 void ComponentLoader::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 475 void ComponentLoader::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
| 472 registry->RegisterStringPref(prefs::kEnterpriseWebStoreURL, | 476 registry->RegisterStringPref(prefs::kEnterpriseWebStoreURL, |
| 473 std::string() /* default_value */, | 477 std::string() /* default_value */, |
| 474 PrefRegistrySyncable::UNSYNCABLE_PREF); | 478 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 475 registry->RegisterStringPref(prefs::kEnterpriseWebStoreName, | 479 registry->RegisterStringPref(prefs::kEnterpriseWebStoreName, |
| 476 std::string() /* default_value */, | 480 std::string() /* default_value */, |
| 477 PrefRegistrySyncable::UNSYNCABLE_PREF); | 481 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 478 } | 482 } |
| 479 | 483 |
| 480 } // namespace extensions | 484 } // namespace extensions |
| OLD | NEW |