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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 void ComponentLoader::RegisterUserPrefs(PrefServiceSyncable* prefs) { | 436 void ComponentLoader::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
437 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, | 437 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, |
438 std::string() /* default_value */, | 438 std::string() /* default_value */, |
439 PrefServiceSyncable::UNSYNCABLE_PREF); | 439 PrefServiceSyncable::UNSYNCABLE_PREF); |
440 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, | 440 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, |
441 std::string() /* default_value */, | 441 std::string() /* default_value */, |
442 PrefServiceSyncable::UNSYNCABLE_PREF); | 442 PrefServiceSyncable::UNSYNCABLE_PREF); |
443 } | 443 } |
444 | 444 |
445 } // namespace extensions | 445 } // namespace extensions |
OLD | NEW |