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

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

Issue 2065893002: bluetooth: android: removed duplicate restart of scanning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved restart of search from Android chooser to chooser controller. Created 4 years, 6 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/android/bluetooth_chooser_android.cc ('k') | 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 void BluetoothDeviceChooserController::AdapterPoweredChanged(bool powered) { 335 void BluetoothDeviceChooserController::AdapterPoweredChanged(bool powered) {
336 if (!powered && discovery_session_.get()) { 336 if (!powered && discovery_session_.get()) {
337 StopDiscoverySession(std::move(discovery_session_)); 337 StopDiscoverySession(std::move(discovery_session_));
338 } 338 }
339 339
340 if (chooser_.get()) { 340 if (chooser_.get()) {
341 chooser_->SetAdapterPresence( 341 chooser_->SetAdapterPresence(
342 powered ? BluetoothChooser::AdapterPresence::POWERED_ON 342 powered ? BluetoothChooser::AdapterPresence::POWERED_ON
343 : BluetoothChooser::AdapterPresence::POWERED_OFF); 343 : BluetoothChooser::AdapterPresence::POWERED_OFF);
344 if (powered) {
345 OnBluetoothChooserEvent(BluetoothChooser::Event::RESCAN,
346 "" /* device_address */);
347 }
344 } 348 }
345 349
346 if (!powered) { 350 if (!powered) {
347 discovery_session_timer_.Stop(); 351 discovery_session_timer_.Stop();
348 } 352 }
349 } 353 }
350 354
351 void BluetoothDeviceChooserController::PopulateFoundDevices() { 355 void BluetoothDeviceChooserController::PopulateFoundDevices() {
352 VLOG(1) << "Populating " << adapter_->GetDevices().size() 356 VLOG(1) << "Populating " << adapter_->GetDevices().size()
353 << " devices in chooser."; 357 << " devices in chooser.";
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 465
462 void BluetoothDeviceChooserController::PostErrorCallback( 466 void BluetoothDeviceChooserController::PostErrorCallback(
463 blink::mojom::WebBluetoothError error) { 467 blink::mojom::WebBluetoothError error) {
464 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( 468 if (!base::ThreadTaskRunnerHandle::Get()->PostTask(
465 FROM_HERE, base::Bind(error_callback_, error))) { 469 FROM_HERE, base::Bind(error_callback_, error))) {
466 LOG(WARNING) << "No TaskRunner."; 470 LOG(WARNING) << "No TaskRunner.";
467 } 471 }
468 } 472 }
469 473
470 } // namespace content 474 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/bluetooth_chooser_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698