| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |