OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |