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

Side by Side Diff: content/browser/bluetooth/bluetooth_dispatcher_host.cc

Issue 1315093002: Implement a bluetooth picker dialog for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 5 years, 3 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 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 // NETWORK_ERROR Note: 5 // NETWORK_ERROR Note:
6 // When a device can't be found in the BluetoothAdapter, that generally 6 // When a device can't be found in the BluetoothAdapter, that generally
7 // indicates that it's gone out of range. We reject with a NetworkError in that 7 // indicates that it's gone out of range. We reject with a NetworkError in that
8 // case. 8 // case.
9 // https://webbluetoothchrome.github.io/web-bluetooth/#dom-bluetoothdevice-conne ctgatt 9 // https://webbluetoothchrome.github.io/web-bluetooth/#dom-bluetoothdevice-conne ctgatt
10 10
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 } 701 }
702 // Ignore discovery session start errors when the dialog was already closed by 702 // Ignore discovery session start errors when the dialog was already closed by
703 // the time they happen. 703 // the time they happen.
704 } 704 }
705 705
706 void BluetoothDispatcherHost::OnBluetoothChooserEvent( 706 void BluetoothDispatcherHost::OnBluetoothChooserEvent(
707 int chooser_id, 707 int chooser_id,
708 BluetoothChooser::Event event, 708 BluetoothChooser::Event event,
709 const std::string& device_id) { 709 const std::string& device_id) {
710 switch (event) { 710 switch (event) {
711 case BluetoothChooser::Event::RESCAN:
712 // TODO(jyasskin): Implement starting a new Bluetooth discovery session.
713 NOTIMPLEMENTED();
714 break;
711 case BluetoothChooser::Event::CANCELLED: 715 case BluetoothChooser::Event::CANCELLED:
712 case BluetoothChooser::Event::SELECTED: 716 case BluetoothChooser::Event::SELECTED:
713 RequestDeviceSession* session = 717 RequestDeviceSession* session =
714 request_device_sessions_.Lookup(chooser_id); 718 request_device_sessions_.Lookup(chooser_id);
715 DCHECK(session) << "Shouldn't close the dialog twice."; 719 DCHECK(session) << "Shouldn't close the dialog twice.";
716 CHECK(session->chooser) << "Shouldn't close the dialog twice."; 720 CHECK(session->chooser) << "Shouldn't close the dialog twice.";
717 721
718 // Synchronously ensure nothing else calls into the chooser after it has 722 // Synchronously ensure nothing else calls into the chooser after it has
719 // asked to be closed. 723 // asked to be closed.
720 session->chooser.reset(); 724 session->chooser.reset();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 int thread_id, 884 int thread_id,
881 int request_id, 885 int request_id,
882 device::BluetoothGattService::GattErrorCode error_code) { 886 device::BluetoothGattService::GattErrorCode error_code) {
883 // TranslateGATTError calls RecordGATTOperationOutcome. 887 // TranslateGATTError calls RecordGATTOperationOutcome.
884 Send(new BluetoothMsg_WriteCharacteristicValueError( 888 Send(new BluetoothMsg_WriteCharacteristicValueError(
885 thread_id, request_id, 889 thread_id, request_id,
886 TranslateGATTError(error_code, UMAGATTOperation::CHARACTERISTIC_WRITE))); 890 TranslateGATTError(error_code, UMAGATTOperation::CHARACTERISTIC_WRITE)));
887 } 891 }
888 892
889 } // namespace content 893 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698