Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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(",")); | |
|
asargent_no_longer_on_chrome
2011/12/14 00:37:45
I guess if people have commas in their filenames t
jvoung - send to chromium...
2011/12/14 03:00:43
Yeah, I'm not sure what would be a better characte
| |
| 471 while (t.GetNext()) { | |
| 472 extensions::UnpackedInstaller::Create(extension_service_.get())-> | |
|
Aaron Boodman
2011/12/14 00:30:44
You could create one instance above the beginning
jvoung - send to chromium...
2011/12/14 03:00:43
Done.
| |
| 473 LoadFromCommandLine(FilePath(t.token())); | |
| 474 } | |
| 470 } | 475 } |
| 471 } | 476 } |
| 472 | 477 |
| 473 // Make the chrome://extension-icon/ resource available. | 478 // Make the chrome://extension-icon/ resource available. |
| 474 GetChromeURLDataManager()->AddDataSource(new ExtensionIconSource(this)); | 479 GetChromeURLDataManager()->AddDataSource(new ExtensionIconSource(this)); |
| 475 | 480 |
| 476 // Initialize extension event routers. Note that on Chrome OS, this will | 481 // 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 | 482 // not succeed if the user has not logged in yet, in which case the |
| 478 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. | 483 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. |
| 479 // The InitEventRouters call used to be in BrowserMain, because when bookmark | 484 // The InitEventRouters call used to be in BrowserMain, because when bookmark |
| (...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1636 FilePath* cache_path, | 1641 FilePath* cache_path, |
| 1637 int* max_size) { | 1642 int* max_size) { |
| 1638 DCHECK(cache_path); | 1643 DCHECK(cache_path); |
| 1639 DCHECK(max_size); | 1644 DCHECK(max_size); |
| 1640 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1645 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
| 1641 if (!path.empty()) | 1646 if (!path.empty()) |
| 1642 *cache_path = path; | 1647 *cache_path = path; |
| 1643 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1648 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
| 1644 prefs_->GetInteger(prefs::kDiskCacheSize); | 1649 prefs_->GetInteger(prefs::kDiskCacheSize); |
| 1645 } | 1650 } |
| OLD | NEW |