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

Side by Side Diff: chrome/browser/ui/webui/gesture_config_ui.cc

Issue 11745006: Added TapSuppressionController params to gesture configurations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed TSC command line parameters Created 7 years, 11 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/ui/gesture_prefs_observer_factory_aura.cc ('k') | chrome/common/pref_names.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/ui/webui/gesture_config_ui.h" 5 #include "chrome/browser/ui/webui/gesture_config_ui.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 void GestureConfigUI::SetPreferenceValue(const base::ListValue* args) { 102 void GestureConfigUI::SetPreferenceValue(const base::ListValue* args) {
103 std::string pref_name; 103 std::string pref_name;
104 double value; 104 double value;
105 105
106 if (!args->GetString(0, &pref_name) || !args->GetDouble(1, &value)) return; 106 if (!args->GetString(0, &pref_name) || !args->GetDouble(1, &value)) return;
107 107
108 Profile* profile = Profile::FromWebUI(web_ui()); 108 Profile* profile = Profile::FromWebUI(web_ui());
109 PrefService* prefs = profile->GetPrefs(); 109 PrefService* prefs = profile->GetPrefs();
110 110
111 prefs->SetDouble(pref_name.c_str(), value); 111 const PrefService::Preference* pref =
112 prefs->FindPreference(pref_name.c_str());
113 switch (pref->GetType()) {
114 case base::Value::TYPE_INTEGER:
115 prefs->SetInteger(pref_name.c_str(), static_cast<int>(value));
116 break;
117 case base::Value::TYPE_DOUBLE:
118 prefs->SetDouble(pref_name.c_str(), value);
119 break;
120 default:
121 NOTREACHED();
122 }
112 } 123 }
113 124
OLDNEW
« no previous file with comments | « chrome/browser/ui/gesture_prefs_observer_factory_aura.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698