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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
410 #endif | 410 #endif |
411 extension_service_.reset(new ExtensionService( | 411 extension_service_.reset(new ExtensionService( |
412 this, | 412 this, |
413 CommandLine::ForCurrentProcess(), | 413 CommandLine::ForCurrentProcess(), |
414 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), | 414 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
415 extension_prefs_.get(), | 415 extension_prefs_.get(), |
416 autoupdate_enabled, | 416 autoupdate_enabled, |
417 extensions_enabled)); | 417 extensions_enabled)); |
418 | 418 |
419 extension_service_->component_loader()->AddDefaultComponentExtensions(); | 419 extension_service_->component_loader()->AddDefaultComponentExtensions(); |
420 if (command_line->HasSwitch(switches::kLoadComponentExtension)) { | |
zel
2011/11/29 00:19:56
Can we make this flag load more than one component
SeRya
2011/11/29 01:35:25
Done.
| |
421 FilePath path = command_line->GetSwitchValuePath( | |
422 switches::kLoadComponentExtension); | |
423 extension_service_->component_loader()->AddFromCommandLine(path); | |
424 } | |
420 extension_service_->Init(); | 425 extension_service_->Init(); |
421 | 426 |
422 if (extensions_enabled) { | 427 if (extensions_enabled) { |
423 // Load any extensions specified with --load-extension. | 428 // Load any extensions specified with --load-extension. |
424 // TODO(yoz): Seems like this should move into ExtensionService::Init. | 429 // TODO(yoz): Seems like this should move into ExtensionService::Init. |
425 if (command_line->HasSwitch(switches::kLoadExtension)) { | 430 if (command_line->HasSwitch(switches::kLoadExtension)) { |
426 FilePath path = command_line->GetSwitchValuePath( | 431 FilePath path = command_line->GetSwitchValuePath( |
427 switches::kLoadExtension); | 432 switches::kLoadExtension); |
428 extensions::UnpackedInstaller::Create(extension_service_.get())-> | 433 extensions::UnpackedInstaller::Create(extension_service_.get())-> |
429 LoadFromCommandLine(path); | 434 LoadFromCommandLine(path); |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1577 FilePath* cache_path, | 1582 FilePath* cache_path, |
1578 int* max_size) { | 1583 int* max_size) { |
1579 DCHECK(cache_path); | 1584 DCHECK(cache_path); |
1580 DCHECK(max_size); | 1585 DCHECK(max_size); |
1581 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1586 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1582 if (!path.empty()) | 1587 if (!path.empty()) |
1583 *cache_path = path; | 1588 *cache_path = path; |
1584 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1589 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1585 prefs_->GetInteger(prefs::kDiskCacheSize); | 1590 prefs_->GetInteger(prefs::kDiskCacheSize); |
1586 } | 1591 } |
OLD | NEW |