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

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

Issue 2304213002: Show device connection and paired status in chooser on Mac (Closed)
Patch Set: added comments Created 4 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
« no previous file with comments | « content/browser/bluetooth/web_bluetooth_service_impl.h ('k') | ui/gfx/vector_icons/BUILD.gn » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // WebBluetoothServiceImpl map [service_id_to_device_address_, 7 // WebBluetoothServiceImpl map [service_id_to_device_address_,
8 // characteristic_id_to_service_id_, descriptor_to_characteristic_] implies a 8 // characteristic_id_to_service_id_, descriptor_to_characteristic_] implies a
9 // hostile renderer because a renderer obtains the corresponding ID from this 9 // hostile renderer because a renderer obtains the corresponding ID from this
10 // class and it will be added to the map at that time. 10 // class and it will be added to the map at that time.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 WebBluetoothServiceImpl::~WebBluetoothServiceImpl() { 199 WebBluetoothServiceImpl::~WebBluetoothServiceImpl() {
200 DCHECK_CURRENTLY_ON(BrowserThread::UI); 200 DCHECK_CURRENTLY_ON(BrowserThread::UI);
201 ClearState(); 201 ClearState();
202 } 202 }
203 203
204 void WebBluetoothServiceImpl::SetClientConnectionErrorHandler( 204 void WebBluetoothServiceImpl::SetClientConnectionErrorHandler(
205 base::Closure closure) { 205 base::Closure closure) {
206 binding_.set_connection_error_handler(closure); 206 binding_.set_connection_error_handler(closure);
207 } 207 }
208 208
209 bool WebBluetoothServiceImpl::IsDevicePaired(
210 const std::string& device_address) {
211 return allowed_devices_map_.GetDeviceId(GetOrigin(), device_address) !=
212 nullptr;
213 }
214
209 void WebBluetoothServiceImpl::DidFinishNavigation( 215 void WebBluetoothServiceImpl::DidFinishNavigation(
210 NavigationHandle* navigation_handle) { 216 NavigationHandle* navigation_handle) {
211 if (navigation_handle->HasCommitted() && 217 if (navigation_handle->HasCommitted() &&
212 navigation_handle->GetRenderFrameHost() == render_frame_host_ && 218 navigation_handle->GetRenderFrameHost() == render_frame_host_ &&
213 !navigation_handle->IsSamePage()) { 219 !navigation_handle->IsSamePage()) {
214 ClearState(); 220 ClearState();
215 } 221 }
216 } 222 }
217 223
218 void WebBluetoothServiceImpl::AdapterPoweredChanged( 224 void WebBluetoothServiceImpl::AdapterPoweredChanged(
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 characteristic_id_to_service_id_.clear(); 1001 characteristic_id_to_service_id_.clear();
996 service_id_to_device_address_.clear(); 1002 service_id_to_device_address_.clear();
997 connected_devices_.reset( 1003 connected_devices_.reset(
998 new FrameConnectedBluetoothDevices(render_frame_host_)); 1004 new FrameConnectedBluetoothDevices(render_frame_host_));
999 allowed_devices_map_ = BluetoothAllowedDevicesMap(); 1005 allowed_devices_map_ = BluetoothAllowedDevicesMap();
1000 device_chooser_controller_.reset(); 1006 device_chooser_controller_.reset();
1001 BluetoothAdapterFactoryWrapper::Get().ReleaseAdapter(this); 1007 BluetoothAdapterFactoryWrapper::Get().ReleaseAdapter(this);
1002 } 1008 }
1003 1009
1004 } // namespace content 1010 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/bluetooth/web_bluetooth_service_impl.h ('k') | ui/gfx/vector_icons/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698