| OLD | NEW |
| 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/test_extension_system.h" | 5 #include "chrome/browser/extensions/test_extension_system.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/extensions/blacklist.h" | 9 #include "chrome/browser/extensions/blacklist.h" |
| 10 #include "chrome/browser/extensions/error_console/error_console.h" | 10 #include "chrome/browser/extensions/error_console/error_console.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 ExtensionPrefs* extension_prefs = ExtensionPrefs::Create( | 71 ExtensionPrefs* extension_prefs = ExtensionPrefs::Create( |
| 72 profile_->GetPrefs(), | 72 profile_->GetPrefs(), |
| 73 install_directory, | 73 install_directory, |
| 74 ExtensionPrefValueMapFactory::GetForBrowserContext(profile_), | 74 ExtensionPrefValueMapFactory::GetForBrowserContext(profile_), |
| 75 ExtensionsBrowserClient::Get()->CreateAppSorting().Pass(), | 75 ExtensionsBrowserClient::Get()->CreateAppSorting().Pass(), |
| 76 extensions_disabled); | 76 extensions_disabled); |
| 77 ExtensionPrefsFactory::GetInstance()->SetInstanceForTesting( | 77 ExtensionPrefsFactory::GetInstance()->SetInstanceForTesting( |
| 78 profile_, | 78 profile_, |
| 79 extension_prefs); | 79 extension_prefs); |
| 80 extension_prefs->Initialize(); |
| 80 return extension_prefs; | 81 return extension_prefs; |
| 81 } | 82 } |
| 82 | 83 |
| 83 ExtensionService* TestExtensionSystem::CreateExtensionService( | 84 ExtensionService* TestExtensionSystem::CreateExtensionService( |
| 84 const CommandLine* command_line, | 85 const CommandLine* command_line, |
| 85 const base::FilePath& install_directory, | 86 const base::FilePath& install_directory, |
| 86 bool autoupdate_enabled) { | 87 bool autoupdate_enabled) { |
| 87 if (!ExtensionPrefs::Get(profile_)) | 88 if (!ExtensionPrefs::Get(profile_)) |
| 88 CreateExtensionPrefs(command_line, install_directory); | 89 CreateExtensionPrefs(command_line, install_directory); |
| 89 install_verifier_.reset( | 90 install_verifier_.reset( |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 const OneShotEvent& TestExtensionSystem::ready() const { | 182 const OneShotEvent& TestExtensionSystem::ready() const { |
| 182 return ready_; | 183 return ready_; |
| 183 } | 184 } |
| 184 | 185 |
| 185 // static | 186 // static |
| 186 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { | 187 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { |
| 187 return new TestExtensionSystem(static_cast<Profile*>(profile)); | 188 return new TestExtensionSystem(static_cast<Profile*>(profile)); |
| 188 } | 189 } |
| 189 | 190 |
| 190 } // namespace extensions | 191 } // namespace extensions |
| OLD | NEW |