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

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

Issue 13416005: Bluetooth: clean up BluetoothDevice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make GetServices return a copy of the list Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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, &params); 502 SendDeviceNotification(device, &params);
504 } 503 }
505 504
506 } // namespace options 505 } // namespace options
507 } // namespace chromeos 506 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698