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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Note that the GetPrefs() creates a TestingPrefService, therefore | 66 // Note that the GetPrefs() creates a TestingPrefService, therefore |
67 // the extension controlled pref values set in ExtensionPrefs | 67 // the extension controlled pref values set in ExtensionPrefs |
68 // are not reflected in the pref service. One would need to | 68 // are not reflected in the pref service. One would need to |
69 // inject a new ExtensionPrefStore(extension_pref_value_map, false). | 69 // inject a new ExtensionPrefStore(extension_pref_value_map, false). |
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 std::vector<ExtensionPrefsObserver*>()); |
77 ExtensionPrefsFactory::GetInstance()->SetInstanceForTesting( | 78 ExtensionPrefsFactory::GetInstance()->SetInstanceForTesting( |
78 profile_, | 79 profile_, |
79 extension_prefs); | 80 extension_prefs); |
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) { |
(...skipping 94 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 |