Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/browser/extensions/component_loader.cc

Issue 11275069: Perform install tasks for newly installed or upgraded component apps/extensions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: various fixes Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/component_loader_unittest.cc » ('j') | chrome/browser/extensions/extension_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698