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

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

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review feedback, simplify threading model. Created 6 years, 9 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
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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 break; 390 break;
391 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE: 391 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE:
392 error_name = "bluetoothConnectUnsupportedDevice"; 392 error_name = "bluetoothConnectUnsupportedDevice";
393 break; 393 break;
394 } 394 }
395 // Report an error only if there's an error to report. 395 // Report an error only if there's an error to report.
396 if (error_name) 396 if (error_name)
397 ReportError(error_name, address); 397 ReportError(error_name, address);
398 } 398 }
399 399
400 void BluetoothOptionsHandler::DisconnectError(const std::string& address) { 400 void BluetoothOptionsHandler::DisconnectError(
401 const std::string& address,
402 const std::string& error_message) {
401 VLOG(1) << "Failed to disconnect from device: " << address; 403 VLOG(1) << "Failed to disconnect from device: " << address;
402 ReportError("bluetoothDisconnectFailed", address); 404 ReportError("bluetoothDisconnectFailed", address);
403 } 405 }
404 406
405 void BluetoothOptionsHandler::ForgetError(const std::string& address) { 407 void BluetoothOptionsHandler::ForgetError(const std::string& address,
408 const std::string& error_message) {
keybuk 2014/03/27 20:20:07 No error_message parameter
rpaquay 2014/03/27 22:00:01 Done.
406 VLOG(1) << "Failed to disconnect and unpair device: " << address; 409 VLOG(1) << "Failed to disconnect and unpair device: " << address;
407 ReportError("bluetoothForgetFailed", address); 410 ReportError("bluetoothForgetFailed", address);
408 } 411 }
409 412
410 void BluetoothOptionsHandler::StopDiscoveryCallback( 413 void BluetoothOptionsHandler::StopDiscoveryCallback(
411 const base::ListValue* args) { 414 const base::ListValue* args) {
412 should_run_device_discovery_ = false; 415 should_run_device_discovery_ = false;
413 if (!discovery_session_.get() || !discovery_session_->IsActive()) { 416 if (!discovery_session_.get() || !discovery_session_->IsActive()) {
414 VLOG(1) << "No active discovery session."; 417 VLOG(1) << "No active discovery session.";
415 return; 418 return;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 void BluetoothOptionsHandler::DeviceConnecting( 579 void BluetoothOptionsHandler::DeviceConnecting(
577 device::BluetoothDevice* device) { 580 device::BluetoothDevice* device) {
578 DCHECK(device); 581 DCHECK(device);
579 base::DictionaryValue params; 582 base::DictionaryValue params;
580 params.SetString("pairing", kStartConnecting); 583 params.SetString("pairing", kStartConnecting);
581 SendDeviceNotification(device, &params); 584 SendDeviceNotification(device, &params);
582 } 585 }
583 586
584 } // namespace options 587 } // namespace options
585 } // namespace chromeos 588 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698