OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/options/chromeos/system_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/system_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/json/json_value_serializer.h" | 13 #include "base/json/json_value_serializer.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "content/browser/tab_contents/tab_contents.h" | 17 #include "content/browser/tab_contents/tab_contents.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/chromeos/accessibility_util.h" | 19 #include "chrome/browser/chromeos/accessibility_util.h" |
20 #include "chrome/browser/chromeos/language_preferences.h" | 20 #include "chrome/browser/chromeos/language_preferences.h" |
| 21 #include "chrome/browser/chromeos/system/touchpad_settings.h" |
21 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
22 #include "chrome/browser/prefs/pref_service.h" | 23 #include "chrome/browser/prefs/pref_service.h" |
23 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/ui/webui/options/chromeos/system_settings_provider.h" | 25 #include "chrome/browser/ui/webui/options/chromeos/system_settings_provider.h" |
25 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
27 #include "chrome/common/extensions/extension.h" | 28 #include "chrome/common/extensions/extension.h" |
28 #include "grit/browser_resources.h" | 29 #include "grit/browser_resources.h" |
29 #include "grit/chromium_strings.h" | 30 #include "grit/chromium_strings.h" |
30 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 "options.SystemOptions.SetAccessibilityCheckboxState", checked); | 111 "options.SystemOptions.SetAccessibilityCheckboxState", checked); |
111 | 112 |
112 // Bluetooth support is a work in progress. Supress the feature unless | 113 // Bluetooth support is a work in progress. Supress the feature unless |
113 // explicitly enabled via a command line flag. | 114 // explicitly enabled via a command line flag. |
114 // TODO (kevers) - Test for presence of bluetooth hardware. | 115 // TODO (kevers) - Test for presence of bluetooth hardware. |
115 if (CommandLine::ForCurrentProcess() | 116 if (CommandLine::ForCurrentProcess() |
116 ->HasSwitch(switches::kEnableBluetooth)) { | 117 ->HasSwitch(switches::kEnableBluetooth)) { |
117 web_ui_->CallJavascriptFunction( | 118 web_ui_->CallJavascriptFunction( |
118 "options.SystemOptions.showBluetoothSettings"); | 119 "options.SystemOptions.showBluetoothSettings"); |
119 } | 120 } |
| 121 |
| 122 if (!chromeos::system::touchpad_settings::TouchpadExists()) |
| 123 web_ui_->CallJavascriptFunction( |
| 124 "options.SystemOptions.hideTapToClick"); |
120 } | 125 } |
121 | 126 |
122 void SystemOptionsHandler::RegisterMessages() { | 127 void SystemOptionsHandler::RegisterMessages() { |
123 DCHECK(web_ui_); | 128 DCHECK(web_ui_); |
124 web_ui_->RegisterMessageCallback("accessibilityChange", | 129 web_ui_->RegisterMessageCallback("accessibilityChange", |
125 base::Bind(&SystemOptionsHandler::AccessibilityChangeCallback, | 130 base::Bind(&SystemOptionsHandler::AccessibilityChangeCallback, |
126 base::Unretained(this))); | 131 base::Unretained(this))); |
127 web_ui_->RegisterMessageCallback("bluetoothEnableChange", | 132 web_ui_->RegisterMessageCallback("bluetoothEnableChange", |
128 NewCallback(this, &SystemOptionsHandler::BluetoothEnableChangeCallback)); | 133 NewCallback(this, &SystemOptionsHandler::BluetoothEnableChangeCallback)); |
129 web_ui_->RegisterMessageCallback("findBluetoothDevices", | 134 web_ui_->RegisterMessageCallback("findBluetoothDevices", |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 device.SetString("deviceName", data[3*i]); | 178 device.SetString("deviceName", data[3*i]); |
174 device.SetString("deviceId", data[3*i+1]); | 179 device.SetString("deviceId", data[3*i+1]); |
175 device.SetString("deviceType", data[3*i+2]); | 180 device.SetString("deviceType", data[3*i+2]); |
176 device.SetString("deviceStatus", "bluetoothDeviceNotPaired"); | 181 device.SetString("deviceStatus", "bluetoothDeviceNotPaired"); |
177 web_ui_->CallJavascriptFunction( | 182 web_ui_->CallJavascriptFunction( |
178 "options.SystemOptions.addBluetoothDevice", device); | 183 "options.SystemOptions.addBluetoothDevice", device); |
179 } | 184 } |
180 web_ui_->CallJavascriptFunction( | 185 web_ui_->CallJavascriptFunction( |
181 "options.SystemOptions.notifyBluetoothSearchComplete"); | 186 "options.SystemOptions.notifyBluetoothSearchComplete"); |
182 } | 187 } |
OLD | NEW |