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

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

Issue 2577183002: Add UMA for the number of devices in the chooser when a device is paired (Closed)
Patch Set: address comments Created 4 years 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 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 } 382 }
383 case ContentBrowserClient::AllowWebBluetoothResult::ALLOW: 383 case ContentBrowserClient::AllowWebBluetoothResult::ALLOW:
384 break; 384 break;
385 } 385 }
386 386
387 BluetoothChooser::EventHandler chooser_event_handler = 387 BluetoothChooser::EventHandler chooser_event_handler =
388 base::Bind(&BluetoothDeviceChooserController::OnBluetoothChooserEvent, 388 base::Bind(&BluetoothDeviceChooserController::OnBluetoothChooserEvent,
389 base::Unretained(this)); 389 base::Unretained(this));
390 390
391 if (WebContentsDelegate* delegate = web_contents_->GetDelegate()) { 391 if (WebContentsDelegate* delegate = web_contents_->GetDelegate()) {
392 chooser_ = delegate->RunBluetoothChooser(render_frame_host_, 392 chooser_ =
393 chooser_event_handler); 393 delegate->RunBluetoothChooser(render_frame_host_, chooser_event_handler,
394 options_->accept_all_devices);
394 } 395 }
395 396
396 if (!chooser_.get()) { 397 if (!chooser_.get()) {
397 PostErrorCallback( 398 PostErrorCallback(
398 blink::mojom::WebBluetoothResult::WEB_BLUETOOTH_NOT_SUPPORTED); 399 blink::mojom::WebBluetoothResult::WEB_BLUETOOTH_NOT_SUPPORTED);
399 return; 400 return;
400 } 401 }
401 402
402 if (!chooser_->CanAskForScanningPermission()) { 403 if (!chooser_->CanAskForScanningPermission()) {
403 VLOG(1) << "Closing immediately because Chooser cannot obtain permission."; 404 VLOG(1) << "Closing immediately because Chooser cannot obtain permission.";
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 610
610 void BluetoothDeviceChooserController::PostErrorCallback( 611 void BluetoothDeviceChooserController::PostErrorCallback(
611 blink::mojom::WebBluetoothResult error) { 612 blink::mojom::WebBluetoothResult error) {
612 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( 613 if (!base::ThreadTaskRunnerHandle::Get()->PostTask(
613 FROM_HERE, base::Bind(error_callback_, error))) { 614 FROM_HERE, base::Bind(error_callback_, error))) {
614 LOG(WARNING) << "No TaskRunner."; 615 LOG(WARNING) << "No TaskRunner.";
615 } 616 }
616 } 617 }
617 618
618 } // namespace content 619 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698