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(); |
- 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)); |
+ break; |
+ case base::Value::TYPE_DOUBLE: |
+ prefs->SetDouble(pref_name.c_str(), value); |
+ break; |
+ default: |
+ NOTREACHED(); |
+ } |
} |