| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 void ComponentLoader::Load(const ComponentExtensionInfo& info) { | 176 void ComponentLoader::Load(const ComponentExtensionInfo& info) { |
| 177 // TODO(abarth): We should REQUIRE_MODERN_MANIFEST_VERSION once we've updated | 177 // TODO(abarth): We should REQUIRE_MODERN_MANIFEST_VERSION once we've updated |
| 178 // our component extensions to the new manifest version. | 178 // our component extensions to the new manifest version. |
| 179 int flags = Extension::REQUIRE_KEY; | 179 int flags = Extension::REQUIRE_KEY; |
| 180 | 180 |
| 181 std::string error; | 181 std::string error; |
| 182 | 182 |
| 183 scoped_refptr<const Extension> extension(Extension::Create( | 183 scoped_refptr<const Extension> extension(Extension::Create( |
| 184 info.root_directory, | 184 info.root_directory, |
| 185 Extension::COMPONENT, | 185 Manifest::COMPONENT, |
| 186 *info.manifest, | 186 *info.manifest, |
| 187 flags, | 187 flags, |
| 188 &error)); | 188 &error)); |
| 189 if (!extension.get()) { | 189 if (!extension.get()) { |
| 190 LOG(ERROR) << error; | 190 LOG(ERROR) << error; |
| 191 return; | 191 return; |
| 192 } | 192 } |
| 193 | 193 |
| 194 CHECK_EQ(info.extension_id, extension->id()) << extension->name(); | 194 CHECK_EQ(info.extension_id, extension->id()) << extension->name(); |
| 195 extension_service_->AddComponentExtension(extension); | 195 extension_service_->AddComponentExtension(extension); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 void ComponentLoader::RegisterUserPrefs(PrefServiceSyncable* prefs) { | 430 void ComponentLoader::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
| 431 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, | 431 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, |
| 432 std::string() /* default_value */, | 432 std::string() /* default_value */, |
| 433 PrefServiceSyncable::UNSYNCABLE_PREF); | 433 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 434 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, | 434 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, |
| 435 std::string() /* default_value */, | 435 std::string() /* default_value */, |
| 436 PrefServiceSyncable::UNSYNCABLE_PREF); | 436 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 437 } | 437 } |
| 438 | 438 |
| 439 } // namespace extensions | 439 } // namespace extensions |
| OLD | NEW |