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/extension_management.h" | 10 #include "chrome/browser/extensions/extension_management.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 command_line && command_line->HasSwitch(switches::kDisableExtensions); | 51 command_line && command_line->HasSwitch(switches::kDisableExtensions); |
52 | 52 |
53 // Note that the GetPrefs() creates a TestingPrefService, therefore | 53 // Note that the GetPrefs() creates a TestingPrefService, therefore |
54 // the extension controlled pref values set in ExtensionPrefs | 54 // the extension controlled pref values set in ExtensionPrefs |
55 // are not reflected in the pref service. One would need to | 55 // are not reflected in the pref service. One would need to |
56 // inject a new ExtensionPrefStore(extension_pref_value_map, false). | 56 // inject a new ExtensionPrefStore(extension_pref_value_map, false). |
57 | 57 |
58 return make_scoped_ptr(ExtensionPrefs::Create( | 58 return make_scoped_ptr(ExtensionPrefs::Create( |
59 profile_->GetPrefs(), install_directory, | 59 profile_->GetPrefs(), install_directory, |
60 ExtensionPrefValueMapFactory::GetForBrowserContext(profile_), | 60 ExtensionPrefValueMapFactory::GetForBrowserContext(profile_), |
61 ExtensionsBrowserClient::Get()->CreateAppSorting().Pass(), | 61 ExtensionsBrowserClient::Get()->CreateAppSorting(nullptr).Pass(), |
not at google - send to devlin
2015/07/23 15:35:11
use profile_ here not nullptr?
Marc Treib
2015/07/24 11:38:34
D'oh. Done.
| |
62 extensions_disabled, std::vector<ExtensionPrefsObserver*>())); | 62 extensions_disabled, std::vector<ExtensionPrefsObserver*>())); |
63 } | 63 } |
64 | 64 |
65 ExtensionService* TestExtensionSystem::CreateExtensionService( | 65 ExtensionService* TestExtensionSystem::CreateExtensionService( |
66 const base::CommandLine* command_line, | 66 const base::CommandLine* command_line, |
67 const base::FilePath& install_directory, | 67 const base::FilePath& install_directory, |
68 bool autoupdate_enabled) { | 68 bool autoupdate_enabled) { |
69 // The ownership of |value_store_| is immediately transferred to state_store_, | 69 // The ownership of |value_store_| is immediately transferred to state_store_, |
70 // but we keep a naked pointer to the TestingValueStore. | 70 // but we keep a naked pointer to the TestingValueStore. |
71 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); | 71 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 } | 137 } |
138 | 138 |
139 // static | 139 // static |
140 scoped_ptr<KeyedService> TestExtensionSystem::Build( | 140 scoped_ptr<KeyedService> TestExtensionSystem::Build( |
141 content::BrowserContext* profile) { | 141 content::BrowserContext* profile) { |
142 return make_scoped_ptr( | 142 return make_scoped_ptr( |
143 new TestExtensionSystem(static_cast<Profile*>(profile))); | 143 new TestExtensionSystem(static_cast<Profile*>(profile))); |
144 } | 144 } |
145 | 145 |
146 } // namespace extensions | 146 } // namespace extensions |
OLD | NEW |