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/options/chromeos/bluetooth_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 SendDeviceNotification(*iter, NULL); | 401 SendDeviceNotification(*iter, NULL); |
402 } | 402 } |
403 | 403 |
404 void BluetoothOptionsHandler::SendDeviceNotification( | 404 void BluetoothOptionsHandler::SendDeviceNotification( |
405 const device::BluetoothDevice* device, | 405 const device::BluetoothDevice* device, |
406 base::DictionaryValue* params) { | 406 base::DictionaryValue* params) { |
407 base::DictionaryValue js_properties; | 407 base::DictionaryValue js_properties; |
408 js_properties.SetString("name", device->GetName()); | 408 js_properties.SetString("name", device->GetName()); |
409 js_properties.SetString("address", device->address()); | 409 js_properties.SetString("address", device->address()); |
410 js_properties.SetBoolean("paired", device->IsPaired()); | 410 js_properties.SetBoolean("paired", device->IsPaired()); |
411 js_properties.SetBoolean("bonded", device->IsBonded()); | |
412 js_properties.SetBoolean("connected", device->IsConnected()); | 411 js_properties.SetBoolean("connected", device->IsConnected()); |
413 js_properties.SetBoolean("connectable", device->IsConnectable()); | 412 js_properties.SetBoolean("connectable", device->IsConnectable()); |
414 if (params) | 413 if (params) |
415 js_properties.MergeDictionary(params); | 414 js_properties.MergeDictionary(params); |
416 web_ui()->CallJavascriptFunction( | 415 web_ui()->CallJavascriptFunction( |
417 "options.BrowserOptions.addBluetoothDevice", | 416 "options.BrowserOptions.addBluetoothDevice", |
418 js_properties); | 417 js_properties); |
419 } | 418 } |
420 | 419 |
421 void BluetoothOptionsHandler::RequestPinCode(device::BluetoothDevice* device) { | 420 void BluetoothOptionsHandler::RequestPinCode(device::BluetoothDevice* device) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 void BluetoothOptionsHandler::DeviceConnecting( | 497 void BluetoothOptionsHandler::DeviceConnecting( |
499 device::BluetoothDevice* device) { | 498 device::BluetoothDevice* device) { |
500 DCHECK(device); | 499 DCHECK(device); |
501 DictionaryValue params; | 500 DictionaryValue params; |
502 params.SetString("pairing", kStartConnecting); | 501 params.SetString("pairing", kStartConnecting); |
503 SendDeviceNotification(device, ¶ms); | 502 SendDeviceNotification(device, ¶ms); |
504 } | 503 } |
505 | 504 |
506 } // namespace options | 505 } // namespace options |
507 } // namespace chromeos | 506 } // namespace chromeos |
OLD | NEW |