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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 8898025: Extend --load-extension commandline to accept multiple (comma-separated) extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: space Created 9 years 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
« no previous file with comments | « chrome/browser/extensions/extension_startup_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 extension_service_->component_loader()->AddOrReplace( 456 extension_service_->component_loader()->AddOrReplace(
457 FilePath(t.token())); 457 FilePath(t.token()));
458 } 458 }
459 } 459 }
460 extension_service_->Init(); 460 extension_service_->Init();
461 461
462 if (extensions_enabled) { 462 if (extensions_enabled) {
463 // Load any extensions specified with --load-extension. 463 // Load any extensions specified with --load-extension.
464 // TODO(yoz): Seems like this should move into ExtensionService::Init. 464 // TODO(yoz): Seems like this should move into ExtensionService::Init.
465 if (command_line->HasSwitch(switches::kLoadExtension)) { 465 if (command_line->HasSwitch(switches::kLoadExtension)) {
466 FilePath path = command_line->GetSwitchValuePath( 466 CommandLine::StringType path_list = command_line->GetSwitchValueNative(
467 switches::kLoadExtension); 467 switches::kLoadExtension);
468 extensions::UnpackedInstaller::Create(extension_service_.get())-> 468 StringTokenizerT<CommandLine::StringType,
469 LoadFromCommandLine(path); 469 CommandLine::StringType::const_iterator> t(path_list,
470 FILE_PATH_LITERAL(","));
471 scoped_refptr<extensions::UnpackedInstaller> installer =
472 extensions::UnpackedInstaller::Create(extension_service_.get());
473 while (t.GetNext()) {
474 installer->LoadFromCommandLine(FilePath(t.token()));
475 }
470 } 476 }
471 } 477 }
472 478
473 // Make the chrome://extension-icon/ resource available. 479 // Make the chrome://extension-icon/ resource available.
474 GetChromeURLDataManager()->AddDataSource(new ExtensionIconSource(this)); 480 GetChromeURLDataManager()->AddDataSource(new ExtensionIconSource(this));
475 481
476 // Initialize extension event routers. Note that on Chrome OS, this will 482 // Initialize extension event routers. Note that on Chrome OS, this will
477 // not succeed if the user has not logged in yet, in which case the 483 // not succeed if the user has not logged in yet, in which case the
478 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. 484 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead.
479 // The InitEventRouters call used to be in BrowserMain, because when bookmark 485 // The InitEventRouters call used to be in BrowserMain, because when bookmark
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 FilePath* cache_path, 1642 FilePath* cache_path,
1637 int* max_size) { 1643 int* max_size) {
1638 DCHECK(cache_path); 1644 DCHECK(cache_path);
1639 DCHECK(max_size); 1645 DCHECK(max_size);
1640 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); 1646 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir));
1641 if (!path.empty()) 1647 if (!path.empty())
1642 *cache_path = path; 1648 *cache_path = path;
1643 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1649 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1644 prefs_->GetInteger(prefs::kDiskCacheSize); 1650 prefs_->GetInteger(prefs::kDiskCacheSize);
1645 } 1651 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_startup_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698