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

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

Issue 1672103002: Pass the frame instead of the WebContents through RunBluetoothChooser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@doc-bubble-lifetimes
Patch Set: Fix Android Created 4 years, 10 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/public/browser/web_contents_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 thread_id, request_id, render_frame_host->GetLastCommittedOrigin(), 1067 thread_id, request_id, render_frame_host->GetLastCommittedOrigin(),
1068 filters, optional_services_blacklist_filtered); 1068 filters, optional_services_blacklist_filtered);
1069 int chooser_id = request_device_sessions_.Add(session); 1069 int chooser_id = request_device_sessions_.Add(session);
1070 1070
1071 BluetoothChooser::EventHandler chooser_event_handler = 1071 BluetoothChooser::EventHandler chooser_event_handler =
1072 base::Bind(&BluetoothDispatcherHost::OnBluetoothChooserEvent, 1072 base::Bind(&BluetoothDispatcherHost::OnBluetoothChooserEvent,
1073 weak_ptr_on_ui_thread_, chooser_id); 1073 weak_ptr_on_ui_thread_, chooser_id);
1074 if (WebContents* web_contents = 1074 if (WebContents* web_contents =
1075 WebContents::FromRenderFrameHost(render_frame_host)) { 1075 WebContents::FromRenderFrameHost(render_frame_host)) {
1076 if (WebContentsDelegate* delegate = web_contents->GetDelegate()) { 1076 if (WebContentsDelegate* delegate = web_contents->GetDelegate()) {
1077 session->chooser = delegate->RunBluetoothChooser( 1077 session->chooser = delegate->RunBluetoothChooser(render_frame_host,
1078 web_contents, chooser_event_handler, 1078 chooser_event_handler);
1079 render_frame_host->GetLastCommittedOrigin());
1080 } 1079 }
1081 } 1080 }
1082 if (!session->chooser) { 1081 if (!session->chooser) {
1083 LOG(WARNING) 1082 LOG(WARNING)
1084 << "No Bluetooth chooser implementation; falling back to first device."; 1083 << "No Bluetooth chooser implementation; falling back to first device.";
1085 session->chooser.reset( 1084 session->chooser.reset(
1086 new FirstDeviceBluetoothChooser(chooser_event_handler)); 1085 new FirstDeviceBluetoothChooser(chooser_event_handler));
1087 } 1086 }
1088 1087
1089 if (!session->chooser->CanAskForScanningPermission()) { 1088 if (!session->chooser->CanAskForScanningPermission()) {
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1514 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1516 NOTIMPLEMENTED(); 1515 NOTIMPLEMENTED();
1517 } 1516 }
1518 1517
1519 void BluetoothDispatcherHost::ShowNeedLocationLink() { 1518 void BluetoothDispatcherHost::ShowNeedLocationLink() {
1520 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1519 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1521 NOTIMPLEMENTED(); 1520 NOTIMPLEMENTED();
1522 } 1521 }
1523 1522
1524 } // namespace content 1523 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/public/browser/web_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698