| OLD | NEW |
| 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 // ID Not In Map Note: | 5 // ID Not In Map Note: |
| 6 // A service, characteristic, or descriptor ID not in the corresponding | 6 // A service, characteristic, or descriptor ID not in the corresponding |
| 7 // BluetoothDispatcherHost map [service_to_device_, characteristic_to_service_, | 7 // BluetoothDispatcherHost map [service_to_device_, characteristic_to_service_, |
| 8 // descriptor_to_characteristic_] implies a hostile renderer because a renderer | 8 // descriptor_to_characteristic_] implies a hostile renderer because a renderer |
| 9 // obtains the corresponding ID from this class and it will be added to the map | 9 // obtains the corresponding ID from this class and it will be added to the map |
| 10 // at that time. | 10 // at that time. |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 int chooser_id = request_device_sessions_.Add(session); | 666 int chooser_id = request_device_sessions_.Add(session); |
| 667 | 667 |
| 668 BluetoothChooser::EventHandler chooser_event_handler = | 668 BluetoothChooser::EventHandler chooser_event_handler = |
| 669 base::Bind(&BluetoothDispatcherHost::OnBluetoothChooserEvent, | 669 base::Bind(&BluetoothDispatcherHost::OnBluetoothChooserEvent, |
| 670 weak_ptr_on_ui_thread_, chooser_id); | 670 weak_ptr_on_ui_thread_, chooser_id); |
| 671 if (WebContents* web_contents = | 671 if (WebContents* web_contents = |
| 672 WebContents::FromRenderFrameHost(render_frame_host)) { | 672 WebContents::FromRenderFrameHost(render_frame_host)) { |
| 673 if (WebContentsDelegate* delegate = web_contents->GetDelegate()) { | 673 if (WebContentsDelegate* delegate = web_contents->GetDelegate()) { |
| 674 session->chooser = delegate->RunBluetoothChooser( | 674 session->chooser = delegate->RunBluetoothChooser( |
| 675 web_contents, chooser_event_handler, | 675 web_contents, chooser_event_handler, |
| 676 // TODO(ortuno): Replace with GetLastCommittedOrigin. | 676 render_frame_host->GetLastCommittedOrigin()); |
| 677 // http://crbug.com/577451 | |
| 678 render_frame_host->GetLastCommittedURL().GetOrigin()); | |
| 679 } | 677 } |
| 680 } | 678 } |
| 681 if (!session->chooser) { | 679 if (!session->chooser) { |
| 682 LOG(WARNING) | 680 LOG(WARNING) |
| 683 << "No Bluetooth chooser implementation; falling back to first device."; | 681 << "No Bluetooth chooser implementation; falling back to first device."; |
| 684 session->chooser.reset( | 682 session->chooser.reset( |
| 685 new FirstDeviceBluetoothChooser(chooser_event_handler)); | 683 new FirstDeviceBluetoothChooser(chooser_event_handler)); |
| 686 } | 684 } |
| 687 | 685 |
| 688 if (!session->chooser->CanAskForScanningPermission()) { | 686 if (!session->chooser->CanAskForScanningPermission()) { |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1456 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1459 NOTIMPLEMENTED(); | 1457 NOTIMPLEMENTED(); |
| 1460 } | 1458 } |
| 1461 | 1459 |
| 1462 void BluetoothDispatcherHost::ShowNeedLocationLink() { | 1460 void BluetoothDispatcherHost::ShowNeedLocationLink() { |
| 1463 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1461 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1464 NOTIMPLEMENTED(); | 1462 NOTIMPLEMENTED(); |
| 1465 } | 1463 } |
| 1466 | 1464 |
| 1467 } // namespace content | 1465 } // namespace content |
| OLD | NEW |