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

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

Issue 11881055: Simplify WebUI data sources. Currently WebUI data sources implement a URLDataSourceDelegate interfa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix issue in about_ui exposed by cros tests 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
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 27 matching lines...) Expand all
38 "setPreferenceValue", 38 "setPreferenceValue",
39 base::Bind(&GestureConfigUI::SetPreferenceValue, 39 base::Bind(&GestureConfigUI::SetPreferenceValue,
40 base::Unretained(this))); 40 base::Unretained(this)));
41 41
42 // Add required resources. 42 // Add required resources.
43 html_source->add_resource_path("gesture_config.css", IDR_GESTURE_CONFIG_CSS); 43 html_source->add_resource_path("gesture_config.css", IDR_GESTURE_CONFIG_CSS);
44 html_source->add_resource_path("gesture_config.js", IDR_GESTURE_CONFIG_JS); 44 html_source->add_resource_path("gesture_config.js", IDR_GESTURE_CONFIG_JS);
45 html_source->set_default_resource(IDR_GESTURE_CONFIG_HTML); 45 html_source->set_default_resource(IDR_GESTURE_CONFIG_HTML);
46 46
47 Profile* profile = Profile::FromWebUI(web_ui); 47 Profile* profile = Profile::FromWebUI(web_ui);
48 ChromeURLDataManager::AddDataSource(profile, html_source); 48 ChromeURLDataManager::AddDataSourceImpl(profile, html_source);
49 } 49 }
50 50
51 GestureConfigUI::~GestureConfigUI() { 51 GestureConfigUI::~GestureConfigUI() {
52 } 52 }
53 53
54 void GestureConfigUI::GetPreferenceValue(const base::ListValue* args) { 54 void GestureConfigUI::GetPreferenceValue(const base::ListValue* args) {
55 std::string pref_name; 55 std::string pref_name;
56 56
57 if (!args->GetString(0, &pref_name)) return; 57 if (!args->GetString(0, &pref_name)) return;
58 58
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 prefs->SetInteger(pref_name.c_str(), static_cast<int>(value)); 115 prefs->SetInteger(pref_name.c_str(), static_cast<int>(value));
116 break; 116 break;
117 case base::Value::TYPE_DOUBLE: 117 case base::Value::TYPE_DOUBLE:
118 prefs->SetDouble(pref_name.c_str(), value); 118 prefs->SetDouble(pref_name.c_str(), value);
119 break; 119 break;
120 default: 120 default:
121 NOTREACHED(); 121 NOTREACHED();
122 } 122 }
123 } 123 }
124 124
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698