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

Side by Side Diff: extensions/browser/api/bluetooth/bluetooth_private_api.cc

Issue 1464443002: bluetooth: android: Add BluetoothDevice::ConnectErrorCode enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: III Created 5 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/bluetooth/bluetooth_private_api.h" 5 #include "extensions/browser/api/bluetooth/bluetooth_private_api.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "device/bluetooth/bluetooth_adapter.h" 10 #include "device/bluetooth/bluetooth_adapter.h"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 break; 528 break;
529 case device::BluetoothDevice::ERROR_AUTH_REJECTED: 529 case device::BluetoothDevice::ERROR_AUTH_REJECTED:
530 result = bt_private::CONNECT_RESULT_TYPE_AUTHREJECTED; 530 result = bt_private::CONNECT_RESULT_TYPE_AUTHREJECTED;
531 break; 531 break;
532 case device::BluetoothDevice::ERROR_AUTH_TIMEOUT: 532 case device::BluetoothDevice::ERROR_AUTH_TIMEOUT:
533 result = bt_private::CONNECT_RESULT_TYPE_AUTHTIMEOUT; 533 result = bt_private::CONNECT_RESULT_TYPE_AUTHTIMEOUT;
534 break; 534 break;
535 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE: 535 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE:
536 result = bt_private::CONNECT_RESULT_TYPE_UNSUPPORTEDDEVICE; 536 result = bt_private::CONNECT_RESULT_TYPE_UNSUPPORTEDDEVICE;
537 break; 537 break;
538 case device::BluetoothDevice::ERROR_ATTRIBUTE_LENGTH_INVALID:
539 result = bt_private::CONNECT_RESULT_TYPE_ATTRIBUTELENGTHINVALID;
540 break;
541 case device::BluetoothDevice::ERROR_CONNECTION_CONGESTED:
542 result = bt_private::CONNECT_RESULT_TYPE_CONNECTIONCONGESTED;
543 break;
544 case device::BluetoothDevice::ERROR_INSUFFICIENT_ENCRYPTION:
545 result = bt_private::CONNECT_RESULT_TYPE_INSUFFICIENTENCRYPTION;
546 break;
547 case device::BluetoothDevice::ERROR_OFFSET_INVALID:
548 result = bt_private::CONNECT_RESULT_TYPE_OFFSETINVALID;
549 break;
550 case device::BluetoothDevice::ERROR_READ_FAILED:
551 result = bt_private::CONNECT_RESULT_TYPE_READFAILED;
552 break;
553 case device::BluetoothDevice::ERROR_REQUEST_NOT_SUPPORTED:
554 result = bt_private::CONNECT_RESULT_TYPE_REQUESTNOTSUPPORTED;
555 break;
556 case device::BluetoothDevice::ERROR_WRITE_FAILED:
Kai Jiang 2015/11/29 10:40:51 ERROR_{READ, WRITE}_NOT_PERMITTED
557 result = bt_private::CONNECT_RESULT_TYPE_WRITEFAILED;
558 break;
Kai Jiang 2015/11/29 10:40:51 sorted above.
538 } 559 }
539 // Set the result type and respond with true (success). 560 // Set the result type and respond with true (success).
540 results_ = bt_private::Connect::Results::Create(result); 561 results_ = bt_private::Connect::Results::Create(result);
541 SendResponse(true); 562 SendResponse(true);
542 } 563 }
543 564
544 //////////////////////////////////////////////////////////////////////////////// 565 ////////////////////////////////////////////////////////////////////////////////
545 566
546 BluetoothPrivatePairFunction::BluetoothPrivatePairFunction() {} 567 BluetoothPrivatePairFunction::BluetoothPrivatePairFunction() {}
547 568
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 device::BluetoothDevice::ConnectErrorCode error) { 609 device::BluetoothDevice::ConnectErrorCode error) {
589 SetError(kPairingFailed); 610 SetError(kPairingFailed);
590 SendResponse(false); 611 SendResponse(false);
591 } 612 }
592 613
593 //////////////////////////////////////////////////////////////////////////////// 614 ////////////////////////////////////////////////////////////////////////////////
594 615
595 } // namespace api 616 } // namespace api
596 617
597 } // namespace extensions 618 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698