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

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

Issue 2238973002: bluetooth: Add missing return when bluetooth not supported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | 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 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" 5 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <unordered_set> 9 #include <unordered_set>
10 10
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 base::Unretained(this)); 305 base::Unretained(this));
306 306
307 if (WebContentsDelegate* delegate = web_contents_->GetDelegate()) { 307 if (WebContentsDelegate* delegate = web_contents_->GetDelegate()) {
308 chooser_ = delegate->RunBluetoothChooser(render_frame_host_, 308 chooser_ = delegate->RunBluetoothChooser(render_frame_host_,
309 chooser_event_handler); 309 chooser_event_handler);
310 } 310 }
311 311
312 if (!chooser_.get()) { 312 if (!chooser_.get()) {
313 PostErrorCallback( 313 PostErrorCallback(
314 blink::mojom::WebBluetoothError::WEB_BLUETOOTH_NOT_SUPPORTED); 314 blink::mojom::WebBluetoothError::WEB_BLUETOOTH_NOT_SUPPORTED);
315 return;
315 } 316 }
316 317
317 if (!chooser_->CanAskForScanningPermission()) { 318 if (!chooser_->CanAskForScanningPermission()) {
318 VLOG(1) << "Closing immediately because Chooser cannot obtain permission."; 319 VLOG(1) << "Closing immediately because Chooser cannot obtain permission.";
319 OnBluetoothChooserEvent(BluetoothChooser::Event::DENIED_PERMISSION, 320 OnBluetoothChooserEvent(BluetoothChooser::Event::DENIED_PERMISSION,
320 "" /* device_address */); 321 "" /* device_address */);
321 return; 322 return;
322 } 323 }
323 324
324 PopulateConnectedDevices(); 325 PopulateConnectedDevices();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 488
488 void BluetoothDeviceChooserController::PostErrorCallback( 489 void BluetoothDeviceChooserController::PostErrorCallback(
489 blink::mojom::WebBluetoothError error) { 490 blink::mojom::WebBluetoothError error) {
490 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( 491 if (!base::ThreadTaskRunnerHandle::Get()->PostTask(
491 FROM_HERE, base::Bind(error_callback_, error))) { 492 FROM_HERE, base::Bind(error_callback_, error))) {
492 LOG(WARNING) << "No TaskRunner."; 493 LOG(WARNING) << "No TaskRunner.";
493 } 494 }
494 } 495 }
495 496
496 } // namespace content 497 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698