| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 info.root_directory, | 190 info.root_directory, |
| 191 Extension::COMPONENT, | 191 Extension::COMPONENT, |
| 192 *info.manifest, | 192 *info.manifest, |
| 193 flags, | 193 flags, |
| 194 &error)); | 194 &error)); |
| 195 if (!extension.get()) { | 195 if (!extension.get()) { |
| 196 LOG(ERROR) << error; | 196 LOG(ERROR) << error; |
| 197 return NULL; | 197 return NULL; |
| 198 } | 198 } |
| 199 CHECK_EQ(info.extension_id, extension->id()) << extension->name(); | 199 CHECK_EQ(info.extension_id, extension->id()) << extension->name(); |
| 200 extension_service_->AddExtension(extension); | 200 extension_service_->AddComponentExtension(extension); |
| 201 return extension; | 201 return extension; |
| 202 } | 202 } |
| 203 | 203 |
| 204 void ComponentLoader::Remove(const FilePath& root_directory) { | 204 void ComponentLoader::Remove(const FilePath& root_directory) { |
| 205 // Find the ComponentExtensionInfo for the extension. | 205 // Find the ComponentExtensionInfo for the extension. |
| 206 RegisteredComponentExtensions::iterator it = component_extensions_.begin(); | 206 RegisteredComponentExtensions::iterator it = component_extensions_.begin(); |
| 207 for (; it != component_extensions_.end(); ++it) { | 207 for (; it != component_extensions_.end(); ++it) { |
| 208 if (it->root_directory == root_directory) { | 208 if (it->root_directory == root_directory) { |
| 209 Remove(GenerateId(it->manifest, root_directory)); | 209 Remove(GenerateId(it->manifest, root_directory)); |
| 210 break; | 210 break; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 void ComponentLoader::RegisterUserPrefs(PrefService* prefs) { | 406 void ComponentLoader::RegisterUserPrefs(PrefService* prefs) { |
| 407 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, | 407 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, |
| 408 std::string() /* default_value */, | 408 std::string() /* default_value */, |
| 409 PrefService::UNSYNCABLE_PREF); | 409 PrefService::UNSYNCABLE_PREF); |
| 410 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, | 410 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, |
| 411 std::string() /* default_value */, | 411 std::string() /* default_value */, |
| 412 PrefService::UNSYNCABLE_PREF); | 412 PrefService::UNSYNCABLE_PREF); |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace extensions | 415 } // namespace extensions |
| OLD | NEW |