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

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

Issue 10908184: Enforce the 'requirements' field in manifests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months 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 | Annotate | Revision Log
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/extension_system.h" 5 #include "chrome/browser/extensions/extension_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/string_tokenizer.h" 10 #include "base/string_tokenizer.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (extensions_enabled) { 155 if (extensions_enabled) {
156 // Load any extensions specified with --load-extension. 156 // Load any extensions specified with --load-extension.
157 // TODO(yoz): Seems like this should move into ExtensionService::Init. 157 // TODO(yoz): Seems like this should move into ExtensionService::Init.
158 // But maybe it's no longer important. 158 // But maybe it's no longer important.
159 if (command_line->HasSwitch(switches::kLoadExtension)) { 159 if (command_line->HasSwitch(switches::kLoadExtension)) {
160 CommandLine::StringType path_list = command_line->GetSwitchValueNative( 160 CommandLine::StringType path_list = command_line->GetSwitchValueNative(
161 switches::kLoadExtension); 161 switches::kLoadExtension);
162 StringTokenizerT<CommandLine::StringType, 162 StringTokenizerT<CommandLine::StringType,
163 CommandLine::StringType::const_iterator> t(path_list, 163 CommandLine::StringType::const_iterator> t(path_list,
164 FILE_PATH_LITERAL(",")); 164 FILE_PATH_LITERAL(","));
165 scoped_refptr<UnpackedInstaller> installer =
166 UnpackedInstaller::Create(extension_service_.get());
167 while (t.GetNext()) { 165 while (t.GetNext()) {
168 installer->LoadFromCommandLine(FilePath(t.token())); 166 UnpackedInstaller::Create(extension_service_.get())->
167 LoadFromCommandLine(FilePath(t.token()));
169 } 168 }
170 } 169 }
171 } 170 }
172 171
173 // Make the chrome://extension-icon/ resource available. 172 // Make the chrome://extension-icon/ resource available.
174 ChromeURLDataManager::AddDataSource(profile_, 173 ChromeURLDataManager::AddDataSource(profile_,
175 new ExtensionIconSource(profile_)); 174 new ExtensionIconSource(profile_));
176 175
177 // Initialize extension event routers. Note that on Chrome OS, this will 176 // Initialize extension event routers. Note that on Chrome OS, this will
178 // not succeed if the user has not logged in yet, in which case the 177 // not succeed if the user has not logged in yet, in which case the
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( 393 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts(
395 const std::string& extension_id, 394 const std::string& extension_id,
396 const extension_misc::UnloadedExtensionReason reason) { 395 const extension_misc::UnloadedExtensionReason reason) {
397 BrowserThread::PostTask( 396 BrowserThread::PostTask(
398 BrowserThread::IO, FROM_HERE, 397 BrowserThread::IO, FROM_HERE,
399 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), 398 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(),
400 extension_id, reason)); 399 extension_id, reason));
401 } 400 }
402 401
403 } // namespace extensions 402 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/requirements_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698