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

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: II Created 5 years, 1 month 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 break; 525 break;
526 case device::BluetoothDevice::ERROR_AUTH_REJECTED: 526 case device::BluetoothDevice::ERROR_AUTH_REJECTED:
527 result = bt_private::CONNECT_RESULT_TYPE_AUTHREJECTED; 527 result = bt_private::CONNECT_RESULT_TYPE_AUTHREJECTED;
528 break; 528 break;
529 case device::BluetoothDevice::ERROR_AUTH_TIMEOUT: 529 case device::BluetoothDevice::ERROR_AUTH_TIMEOUT:
530 result = bt_private::CONNECT_RESULT_TYPE_AUTHTIMEOUT; 530 result = bt_private::CONNECT_RESULT_TYPE_AUTHTIMEOUT;
531 break; 531 break;
532 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE: 532 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE:
533 result = bt_private::CONNECT_RESULT_TYPE_UNSUPPORTEDDEVICE; 533 result = bt_private::CONNECT_RESULT_TYPE_UNSUPPORTEDDEVICE;
534 break; 534 break;
535 case device::BluetoothDevice::ERROR_ATTRIBUTE_LENGTH_INVALID:
536 result = bt_private::CONNECT_RESULT_TYPE_ATTRIBUTELENGTHINVALID;
537 break;
538 case device::BluetoothDevice::ERROR_CONNECTION_CONGESTED:
539 result = bt_private::CONNECT_RESULT_TYPE_CONNECTIONCONGESTED;
540 break;
541 case device::BluetoothDevice::ERROR_INSUFFICIENT_ENCRYPTION:
542 result = bt_private::CONNECT_RESULT_TYPE_INSUFFICIENTENCRYPTION;
543 break;
544 case device::BluetoothDevice::ERROR_OFFSET_INVALID:
545 result = bt_private::CONNECT_RESULT_TYPE_OFFSETINVALID;
546 break;
547 case device::BluetoothDevice::ERROR_READ_FAILED:
548 result = bt_private::CONNECT_RESULT_TYPE_READFAILED;
549 break;
550 case device::BluetoothDevice::ERROR_REQUEST_NOT_SUPPORTED:
551 result = bt_private::CONNECT_RESULT_TYPE_REQUESTNOTSUPPORTED;
552 break;
553 case device::BluetoothDevice::ERROR_WRITE_FAILED:
554 result = bt_private::CONNECT_RESULT_TYPE_WRITEFAILED;
555 break;
535 } 556 }
536 // Set the result type and respond with true (success). 557 // Set the result type and respond with true (success).
537 results_ = bt_private::Connect::Results::Create(result); 558 results_ = bt_private::Connect::Results::Create(result);
538 SendResponse(true); 559 SendResponse(true);
539 } 560 }
540 561
541 //////////////////////////////////////////////////////////////////////////////// 562 ////////////////////////////////////////////////////////////////////////////////
542 563
543 BluetoothPrivatePairFunction::BluetoothPrivatePairFunction() {} 564 BluetoothPrivatePairFunction::BluetoothPrivatePairFunction() {}
544 565
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 device::BluetoothDevice::ConnectErrorCode error) { 606 device::BluetoothDevice::ConnectErrorCode error) {
586 SetError(kPairingFailed); 607 SetError(kPairingFailed);
587 SendResponse(false); 608 SendResponse(false);
588 } 609 }
589 610
590 //////////////////////////////////////////////////////////////////////////////// 611 ////////////////////////////////////////////////////////////////////////////////
591 612
592 } // namespace api 613 } // namespace api
593 614
594 } // namespace extensions 615 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698