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

Side by Side Diff: components/proximity_auth/ble/proximity_auth_ble_system.cc

Issue 1113793002: Fix discovery of Smart Lock service in Proximity Auth over Blutooth Low Energy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eu_4
Patch Set: Nit Created 5 years, 7 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 | « components/proximity_auth/ble/bluetooth_low_energy_connection_finder.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ble/proximity_auth_ble_system.h" 5 #include "components/proximity_auth/ble/proximity_auth_ble_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h " 9 #include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h "
10 #include "components/proximity_auth/connection.h" 10 #include "components/proximity_auth/connection.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 VLOG(1) << "OnScreenDidUnlock: " << screen_type; 63 VLOG(1) << "OnScreenDidUnlock: " << screen_type;
64 connection_finder_.reset(); 64 connection_finder_.reset();
65 }; 65 };
66 66
67 void ProximityAuthBleSystem::OnFocusedUserChanged(const std::string& user_id) { 67 void ProximityAuthBleSystem::OnFocusedUserChanged(const std::string& user_id) {
68 VLOG(1) << "OnFocusedUserChanged: " << user_id; 68 VLOG(1) << "OnFocusedUserChanged: " << user_id;
69 }; 69 };
70 70
71 void ProximityAuthBleSystem::OnConnectionFound( 71 void ProximityAuthBleSystem::OnConnectionFound(
72 scoped_ptr<device::BluetoothGattConnection> connection) { 72 scoped_ptr<device::BluetoothGattConnection> connection) {
73 VLOG(1) << "Connection found. Unlock.";
74
75 // Close the connection as it it no longer needed.
76 connection_finder_->CloseConnection(connection.Pass());
77
73 // Unlock the screen when a connection is found. 78 // Unlock the screen when a connection is found.
74 // 79 //
75 // Note that this magically unlocks Chrome (no user interaction is needed). 80 // Note that this magically unlocks Chrome (no user interaction is needed).
76 // This user experience for this operation will be greately improved once 81 // This user experience for this operation will be greately improved once
77 // the Proximity Auth Unlock Manager migration to C++ is done. 82 // the Proximity Auth Unlock Manager migration to C++ is done.
78 screenlock_bridge_->Unlock(browser_context_); 83 screenlock_bridge_->Unlock(browser_context_);
79 } 84 }
80 85
81 } // namespace proximity_auth 86 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698