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

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

Issue 12222004: Bluetooth UI: A "connecting" overlay is shown after enter a pin code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: nits solved. Created 7 years, 10 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
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
index 4f32052c32bed05b09e6e2a2da79aa4d1fc2980f..5cb65fd042400ba318643ba0586fe6794e447211 100644
--- a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
@@ -40,6 +40,7 @@ const char kForgetCommand[] = "forget";
// |SendDeviceNotification| may include a pairing parameter whose value
// is one of the following constants instructing the UI to perform a certain
// action.
+const char kStartConnecting[] = "bluetoothStartConnecting";
const char kEnterPinCode[] = "bluetoothEnterPinCode";
const char kEnterPasskey[] = "bluetoothEnterPasskey";
const char kRemotePinCode[] = "bluetoothRemotePinCode";
@@ -264,6 +265,7 @@ void BluetoothOptionsHandler::UpdateDeviceCallback(
args->GetString(kUpdateDeviceAuthTokenIndex, &auth_token);
if (device->ExpectingPinCode()) {
+ DeviceConnecting(device);
// PIN Code is an array of 1 to 16 8-bit bytes, the usual
// interpretation, and the one shared by BlueZ, is a UTF-8 string
// of as many characters that will fit in that space, thus we
@@ -271,6 +273,7 @@ void BluetoothOptionsHandler::UpdateDeviceCallback(
DVLOG(1) << "PIN Code supplied: " << address << ": " << auth_token;
device->SetPinCode(auth_token);
} else if (device->ExpectingPasskey()) {
+ DeviceConnecting(device);
// Passkey is a numeric in the range 0-999999, in this case the
// JavaScript code should have ensured the auth token string only
// contains digits so a simple conversion is sufficient. In the
@@ -407,9 +410,8 @@ void BluetoothOptionsHandler::SendDeviceNotification(
js_properties.SetBoolean("paired", device->IsPaired());
js_properties.SetBoolean("bonded", device->IsBonded());
js_properties.SetBoolean("connected", device->IsConnected());
- if (params) {
+ if (params)
js_properties.MergeDictionary(params);
- }
web_ui()->CallJavascriptFunction(
"options.BrowserOptions.addBluetoothDevice",
js_properties);
@@ -492,5 +494,13 @@ void BluetoothOptionsHandler::DeviceRemoved(device::BluetoothAdapter* adapter,
address);
}
+void BluetoothOptionsHandler::DeviceConnecting(
+ device::BluetoothDevice* device) {
+ DCHECK(device);
+ DictionaryValue params;
+ params.SetString("pairing", kStartConnecting);
+ SendDeviceNotification(device, &params);
+}
+
} // namespace options
} // namespace chromeos
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698