Chromium Code Reviews| Index: chrome/browser/ui/webui/gesture_config_ui.cc |
| diff --git a/chrome/browser/ui/webui/gesture_config_ui.cc b/chrome/browser/ui/webui/gesture_config_ui.cc |
| index 8f90f0dc53c2cbe7f90b37ff7998ac0a5118a967..6797789ad415568c706e8da56571e473b2f090f2 100644 |
| --- a/chrome/browser/ui/webui/gesture_config_ui.cc |
| +++ b/chrome/browser/ui/webui/gesture_config_ui.cc |
| @@ -108,6 +108,17 @@ void GestureConfigUI::SetPreferenceValue(const base::ListValue* args) { |
| Profile* profile = Profile::FromWebUI(web_ui()); |
| PrefService* prefs = profile->GetPrefs(); |
|
mohsen
2013/01/03 15:20:28
The following part is to add the ability to set in
|
| - prefs->SetDouble(pref_name.c_str(), value); |
| + const PrefService::Preference* pref = |
| + prefs->FindPreference(pref_name.c_str()); |
| + switch (pref->GetType()) { |
| + case base::Value::TYPE_INTEGER: |
| + prefs->SetInteger(pref_name.c_str(), static_cast<int>(value)); |
|
rjkroege
2013/01/03 22:42:49
the type conversion would happen implicitly? Is th
mohsen
2013/01/04 16:14:22
The main reason is that I wrote this code similar
|
| + break; |
| + case base::Value::TYPE_DOUBLE: |
| + prefs->SetDouble(pref_name.c_str(), value); |
| + break; |
| + default: |
| + NOTREACHED(); |
| + } |
| } |