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

Unified Diff: chrome/browser/prefs/command_line_pref_store.cc

Issue 5646003: Sanitize PrefStore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrefService mock construction in PrefServiceTest to include command line store. Created 10 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prefs/command_line_pref_store.cc
diff --git a/chrome/browser/prefs/command_line_pref_store.cc b/chrome/browser/prefs/command_line_pref_store.cc
index 2bebe5b25ff06c049b6c819f6b656e77722ff80b..8fffb9c39d5dd3a5ab8c2f32fdb10e3b41d9690d 100644
--- a/chrome/browser/prefs/command_line_pref_store.cc
+++ b/chrome/browser/prefs/command_line_pref_store.cc
@@ -34,24 +34,20 @@ const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry
};
CommandLinePrefStore::CommandLinePrefStore(const CommandLine* command_line)
- : command_line_(command_line),
- prefs_(new DictionaryValue()) {}
-
-CommandLinePrefStore::~CommandLinePrefStore() {}
-
-PrefStore::PrefReadError CommandLinePrefStore::ReadPrefs() {
+ : command_line_(command_line) {
ApplySimpleSwitches();
ValidateProxySwitches();
- return PrefStore::PREF_READ_ERROR_NONE;
}
+CommandLinePrefStore::~CommandLinePrefStore() {}
+
void CommandLinePrefStore::ApplySimpleSwitches() {
// Look for each switch we know about and set its preference accordingly.
for (size_t i = 0; i < arraysize(string_switch_map_); ++i) {
if (command_line_->HasSwitch(string_switch_map_[i].switch_name)) {
Value* value = Value::CreateStringValue(command_line_->
GetSwitchValueASCII(string_switch_map_[i].switch_name));
- prefs_->Set(string_switch_map_[i].preference_path, value);
+ SetValue(string_switch_map_[i].preference_path, value);
}
}
@@ -59,7 +55,7 @@ void CommandLinePrefStore::ApplySimpleSwitches() {
if (command_line_->HasSwitch(boolean_switch_map_[i].switch_name)) {
Value* value = Value::CreateBooleanValue(
boolean_switch_map_[i].set_value);
- prefs_->Set(boolean_switch_map_[i].preference_path, value);
+ SetValue(boolean_switch_map_[i].preference_path, value);
}
}
}
« no previous file with comments | « chrome/browser/prefs/command_line_pref_store.h ('k') | chrome/browser/prefs/command_line_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698