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

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

Issue 1352063002: Change chrome://proximity-auth to use RemoteDeviceLifeCycle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_mocks
Patch Set: fix win compile Created 5 years, 2 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 | components/proximity_auth/remote_device_life_cycle_impl.cc » ('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 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 void BluetoothConnectionFinder::Find( 35 void BluetoothConnectionFinder::Find(
36 const ConnectionCallback& connection_callback) { 36 const ConnectionCallback& connection_callback) {
37 if (!device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable()) { 37 if (!device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable()) {
38 PA_LOG(WARNING) << "Bluetooth is unsupported on this platform. Aborting."; 38 PA_LOG(WARNING) << "Bluetooth is unsupported on this platform. Aborting.";
39 return; 39 return;
40 } 40 }
41 41
42 DCHECK(start_time_.is_null()); 42 DCHECK(start_time_.is_null());
43 PA_LOG(WARNING) << "Finding Bluetooth connection...";
44 43
45 start_time_ = base::TimeTicks::Now(); 44 start_time_ = base::TimeTicks::Now();
46 connection_callback_ = connection_callback; 45 connection_callback_ = connection_callback;
47 46
48 device::BluetoothAdapterFactory::GetAdapter( 47 device::BluetoothAdapterFactory::GetAdapter(
49 base::Bind(&BluetoothConnectionFinder::OnAdapterInitialized, 48 base::Bind(&BluetoothConnectionFinder::OnAdapterInitialized,
50 weak_ptr_factory_.GetWeakPtr())); 49 weak_ptr_factory_.GetWeakPtr()));
51 } 50 }
52 51
53 scoped_ptr<Connection> BluetoothConnectionFinder::CreateConnection() { 52 scoped_ptr<Connection> BluetoothConnectionFinder::CreateConnection() {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 << "Connection failed! Scheduling another polling iteration."; 195 << "Connection failed! Scheduling another polling iteration.";
197 PostDelayedPoll(); 196 PostDelayedPoll();
198 } 197 }
199 } 198 }
200 199
201 void BluetoothConnectionFinder::InvokeCallbackAsync() { 200 void BluetoothConnectionFinder::InvokeCallbackAsync() {
202 connection_callback_.Run(connection_.Pass()); 201 connection_callback_.Run(connection_.Pass());
203 } 202 }
204 203
205 } // namespace proximity_auth 204 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « no previous file | components/proximity_auth/remote_device_life_cycle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698