Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(941)

Side by Side Diff: chrome/browser/extensions/test_extension_prefs.cc

Issue 1254363004: Move ownership of AppSorting from ExtensionPrefs to ExtensionSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_prefs.h" 5 #include "chrome/browser/extensions/test_extension_prefs.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 PrefServiceMockFactory factory; 109 PrefServiceMockFactory factory;
110 factory.SetUserPrefsFile(preferences_file_, task_runner_.get()); 110 factory.SetUserPrefsFile(preferences_file_, task_runner_.get());
111 factory.set_extension_prefs( 111 factory.set_extension_prefs(
112 new ExtensionPrefStore(extension_pref_value_map_.get(), false)); 112 new ExtensionPrefStore(extension_pref_value_map_.get(), false));
113 pref_service_ = factory.CreateSyncable(pref_registry_.get()).Pass(); 113 pref_service_ = factory.CreateSyncable(pref_registry_.get()).Pass();
114 114
115 prefs_.reset(ExtensionPrefs::Create( 115 prefs_.reset(ExtensionPrefs::Create(
116 pref_service_.get(), 116 pref_service_.get(),
117 temp_dir_.path(), 117 temp_dir_.path(),
118 extension_pref_value_map_.get(), 118 extension_pref_value_map_.get(),
119 ExtensionsBrowserClient::Get()->CreateAppSorting(nullptr).Pass(),
120 extensions_disabled_, 119 extensions_disabled_,
121 std::vector<ExtensionPrefsObserver*>(), 120 std::vector<ExtensionPrefsObserver*>(),
122 // Guarantee that no two extensions get the same installation time 121 // Guarantee that no two extensions get the same installation time
123 // stamp and we can reliably assert the installation order in the tests. 122 // stamp and we can reliably assert the installation order in the tests.
124 scoped_ptr<ExtensionPrefs::TimeProvider>(new IncrementalTimeProvider()))); 123 scoped_ptr<ExtensionPrefs::TimeProvider>(new IncrementalTimeProvider())));
125 } 124 }
126 125
127 scoped_refptr<Extension> TestExtensionPrefs::AddExtension( 126 scoped_refptr<Extension> TestExtensionPrefs::AddExtension(
128 const std::string& name) { 127 const std::string& name) {
129 base::DictionaryValue dictionary; 128 base::DictionaryValue dictionary;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { 185 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const {
187 return pref_service_->CreateIncognitoPrefService( 186 return pref_service_->CreateIncognitoPrefService(
188 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); 187 new ExtensionPrefStore(extension_pref_value_map_.get(), true));
189 } 188 }
190 189
191 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { 190 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) {
192 extensions_disabled_ = extensions_disabled; 191 extensions_disabled_ = extensions_disabled;
193 } 192 }
194 193
195 } // namespace extensions 194 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698