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

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

Issue 18199003: Allow Chrome OS login profile to have different default pref values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.cc ('k') | chrome/browser/first_run/first_run.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return pref_service_.get(); 75 return pref_service_.get();
76 } 76 }
77 77
78 const scoped_refptr<user_prefs::PrefRegistrySyncable>& 78 const scoped_refptr<user_prefs::PrefRegistrySyncable>&
79 TestExtensionPrefs::pref_registry() { 79 TestExtensionPrefs::pref_registry() {
80 return pref_registry_; 80 return pref_registry_;
81 } 81 }
82 82
83 void TestExtensionPrefs::ResetPrefRegistry() { 83 void TestExtensionPrefs::ResetPrefRegistry() {
84 pref_registry_ = new user_prefs::PrefRegistrySyncable; 84 pref_registry_ = new user_prefs::PrefRegistrySyncable;
85 ExtensionPrefs::RegisterUserPrefs(pref_registry_.get()); 85 ExtensionPrefs::RegisterProfilePrefs(pref_registry_.get());
86 } 86 }
87 87
88 void TestExtensionPrefs::RecreateExtensionPrefs() { 88 void TestExtensionPrefs::RecreateExtensionPrefs() {
89 // We persist and reload the PrefService's PrefStores because this process 89 // We persist and reload the PrefService's PrefStores because this process
90 // deletes all empty dictionaries. The ExtensionPrefs implementation 90 // deletes all empty dictionaries. The ExtensionPrefs implementation
91 // needs to be able to handle this situation. 91 // needs to be able to handle this situation.
92 if (pref_service_) { 92 if (pref_service_) {
93 // Commit a pending write (which posts a task to task_runner_) and wait for 93 // Commit a pending write (which posts a task to task_runner_) and wait for
94 // it to finish. 94 // it to finish.
95 pref_service_->CommitPendingWrite(); 95 pref_service_->CommitPendingWrite();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { 173 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const {
174 return pref_service_->CreateIncognitoPrefService( 174 return pref_service_->CreateIncognitoPrefService(
175 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); 175 new ExtensionPrefStore(extension_pref_value_map_.get(), true));
176 } 176 }
177 177
178 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { 178 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) {
179 extensions_disabled_ = extensions_disabled; 179 extensions_disabled_ = extensions_disabled;
180 } 180 }
181 181
182 } // namespace extensions 182 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.cc ('k') | chrome/browser/first_run/first_run.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698