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

Side by Side Diff: components/proximity_auth/bluetooth_connection_finder.cc

Issue 2808353004: bluetooth: Rename Is*Available to Is*Supported (Closed)
Patch Set: Add const Created 3 years, 8 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
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 #include "components/proximity_auth/bluetooth_connection_finder.h" 5 #include "components/proximity_auth/bluetooth_connection_finder.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 19 matching lines...) Expand all
30 has_delayed_poll_scheduled_(false), 30 has_delayed_poll_scheduled_(false),
31 weak_ptr_factory_(this) {} 31 weak_ptr_factory_(this) {}
32 32
33 BluetoothConnectionFinder::~BluetoothConnectionFinder() { 33 BluetoothConnectionFinder::~BluetoothConnectionFinder() {
34 UnregisterAsObserver(); 34 UnregisterAsObserver();
35 } 35 }
36 36
37 void BluetoothConnectionFinder::Find( 37 void BluetoothConnectionFinder::Find(
38 const cryptauth::ConnectionFinder::ConnectionCallback& 38 const cryptauth::ConnectionFinder::ConnectionCallback&
39 connection_callback) { 39 connection_callback) {
40 if (!device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable()) { 40 if (!device::BluetoothAdapterFactory::IsBluetoothSupported()) {
41 PA_LOG(WARNING) << "Bluetooth is unsupported on this platform. Aborting."; 41 PA_LOG(WARNING) << "Bluetooth is unsupported on this platform. Aborting.";
42 return; 42 return;
43 } 43 }
44 44
45 DCHECK(start_time_.is_null()); 45 DCHECK(start_time_.is_null());
46 46
47 start_time_ = base::TimeTicks::Now(); 47 start_time_ = base::TimeTicks::Now();
48 connection_callback_ = connection_callback; 48 connection_callback_ = connection_callback;
49 49
50 device::BluetoothAdapterFactory::GetAdapter( 50 device::BluetoothAdapterFactory::GetAdapter(
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 << "Connection failed! Scheduling another polling iteration."; 202 << "Connection failed! Scheduling another polling iteration.";
203 PostDelayedPoll(); 203 PostDelayedPoll();
204 } 204 }
205 } 205 }
206 206
207 void BluetoothConnectionFinder::InvokeCallbackAsync() { 207 void BluetoothConnectionFinder::InvokeCallbackAsync() {
208 connection_callback_.Run(std::move(connection_)); 208 connection_callback_.Run(std::move(connection_));
209 } 209 }
210 210
211 } // namespace proximity_auth 211 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/bluetooth_connection.cc ('k') | components/proximity_auth/bluetooth_connection_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698