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

Unified Diff: chrome/browser/ui/webui/options/chromeos/system_options_handler.cc

Issue 8366016: Split out bluetooth UI handler from system UI handler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk. Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/chromeos/system_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/system_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/system_options_handler.cc
index 8dc4be0a90b7e51a9c092a9a61ae2af305915474..880ace66d7c48f49de4c3d218c9b3f59e18a8489 100644
--- a/chrome/browser/ui/webui/options/chromeos/system_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/system_options_handler.cc
@@ -79,23 +79,6 @@ void SystemOptionsHandler::GetLocalizedValues(
l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_SENSITIVITY_MORE_DESCRIPTION));
- localized_strings->SetString("bluetooth",
- l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH));
- localized_strings->SetString("enableBluetooth",
- l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_BLUETOOTH_ENABLE));
- localized_strings->SetString("findBluetoothDevices",
- l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_FIND_BLUETOOTH_DEVICES));
- localized_strings->SetString("bluetoothScanning",
- l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_BLUETOOTH_SCANNING));
- localized_strings->SetString("bluetoothDeviceConnected",
- l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_BLUETOOTH_CONNECTED));
- localized_strings->SetString("bluetoothDeviceNotPaired",
- l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_BLUETOOTH_NOT_PAIRED));
- localized_strings->SetString("bluetoothConnectDevice",
- l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_BLUETOOTH_CONNECT));
- localized_strings->SetString("bluetoothDisconnectDevice",
- l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_BLUETOOTH_DISCONNECT));
-
localized_strings->SetString("language",
l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_SECTION_TITLE_LANGUAGE));
localized_strings->SetString("languageCustomize",
@@ -123,15 +106,6 @@ void SystemOptionsHandler::Initialize() {
base::FundamentalValue checked(acc_enabled);
web_ui_->CallJavascriptFunction(
"options.SystemOptions.SetAccessibilityCheckboxState", checked);
-
- // Bluetooth support is a work in progress. Supress the feature unless
- // explicitly enabled via a command line flag.
- // TODO (kevers) - Test for presence of bluetooth hardware.
- if (CommandLine::ForCurrentProcess()
- ->HasSwitch(switches::kEnableBluetooth)) {
- web_ui_->CallJavascriptFunction(
- "options.SystemOptions.showBluetoothSettings");
- }
}
void SystemOptionsHandler::RegisterMessages() {
@@ -146,13 +120,6 @@ void SystemOptionsHandler::RegisterMessages() {
web_ui_->RegisterMessageCallback("increaseScreenBrightness",
base::Bind(&SystemOptionsHandler::IncreaseScreenBrightnessCallback,
base::Unretained(this)));
-
- web_ui_->RegisterMessageCallback("bluetoothEnableChange",
- base::Bind(&SystemOptionsHandler::BluetoothEnableChangeCallback,
- base::Unretained(this)));
- web_ui_->RegisterMessageCallback("findBluetoothDevices",
- base::Bind(&SystemOptionsHandler::FindBluetoothDevicesCallback,
- base::Unretained(this)));
}
void SystemOptionsHandler::AccessibilityChangeCallback(const ListValue* args) {
@@ -176,46 +143,3 @@ void SystemOptionsHandler::IncreaseScreenBrightnessCallback(
chromeos::DBusThreadManager::Get()->power_manager_client()->
IncreaseScreenBrightness();
}
-
-void SystemOptionsHandler::BluetoothEnableChangeCallback(
- const ListValue* args) {
- // TODO (kevers) - Call Bluetooth API to enable or disable.
-}
-
-void SystemOptionsHandler::FindBluetoothDevicesCallback(
- const ListValue* args) {
- // TODO (kevers) - Call Bluetooth API to fetch devices.
- // Generate a fake list until the bluetooth API is ready.
- // Afterwards keep fake list only for cases where emulating
- // ChromeOS from the desktop launch.
- GenerateFakeDeviceList();
-}
-
-void SystemOptionsHandler::BluetoothDeviceNotification(
- const DictionaryValue& device) {
- web_ui_->CallJavascriptFunction(
- "options.SystemOptions.addBluetoothDevice", device);
-}
-
-void SystemOptionsHandler::GenerateFakeDeviceList() {
- // TODO (kevers) - Send notifications asynchronously simulating that the
- // process of discovering bluetooth devices takes time.
- // Fire each notification using OneShotTimer with a
- // varying delay.
- std::string data[9] = {
- "Fake Wireless Keyboard", "01-02-03-04-05", "keyboard",
- "Fake Wireless Mouse", "02-03-04-05-01", "mouse",
- "Fake Wireless Headset", "03-04-05-01-02", "headset"};
-
- for (int i = 0; i < 3; i++) {
- DictionaryValue device;
- device.SetString("deviceName", data[3*i]);
- device.SetString("deviceId", data[3*i+1]);
- device.SetString("deviceType", data[3*i+2]);
- device.SetString("deviceStatus", "bluetoothDeviceNotPaired");
- web_ui_->CallJavascriptFunction(
- "options.SystemOptions.addBluetoothDevice", device);
- }
- web_ui_->CallJavascriptFunction(
- "options.SystemOptions.notifyBluetoothSearchComplete");
-}
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/system_options_handler.h ('k') | chrome/browser/ui/webui/options/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698