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

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

Issue 1251323003: Cleanup: give ChromeAppSorting a BrowserContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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().Pass(), 119 ExtensionsBrowserClient::Get()->CreateAppSorting(nullptr).Pass(),
120 extensions_disabled_, 120 extensions_disabled_,
121 std::vector<ExtensionPrefsObserver*>(), 121 std::vector<ExtensionPrefsObserver*>(),
122 // Guarantee that no two extensions get the same installation time 122 // Guarantee that no two extensions get the same installation time
123 // stamp and we can reliably assert the installation order in the tests. 123 // stamp and we can reliably assert the installation order in the tests.
124 scoped_ptr<ExtensionPrefs::TimeProvider>(new IncrementalTimeProvider()))); 124 scoped_ptr<ExtensionPrefs::TimeProvider>(new IncrementalTimeProvider())));
125 } 125 }
126 126
127 scoped_refptr<Extension> TestExtensionPrefs::AddExtension( 127 scoped_refptr<Extension> TestExtensionPrefs::AddExtension(
128 const std::string& name) { 128 const std::string& name) {
129 base::DictionaryValue dictionary; 129 base::DictionaryValue dictionary;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { 186 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const {
187 return pref_service_->CreateIncognitoPrefService( 187 return pref_service_->CreateIncognitoPrefService(
188 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); 188 new ExtensionPrefStore(extension_pref_value_map_.get(), true));
189 } 189 }
190 190
191 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { 191 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) {
192 extensions_disabled_ = extensions_disabled; 192 extensions_disabled_ = extensions_disabled;
193 } 193 }
194 194
195 } // namespace extensions 195 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_sync_service.cc ('k') | chrome/browser/extensions/test_extension_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698