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

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

Issue 2845433003: [EasyUnlock] Update ProximityMonitor to only check for RSSI proximity. (Closed)
Patch Set: fixes Created 3 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
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/fake_remote_device_life_cycle.h" 5 #include "components/proximity_auth/fake_remote_device_life_cycle.h"
6 6
7 namespace proximity_auth { 7 namespace proximity_auth {
8 8
9 FakeRemoteDeviceLifeCycle::FakeRemoteDeviceLifeCycle( 9 FakeRemoteDeviceLifeCycle::FakeRemoteDeviceLifeCycle(
10 const cryptauth::RemoteDevice& remote_device) 10 const cryptauth::RemoteDevice& remote_device)
11 : remote_device_(remote_device), 11 : remote_device_(remote_device),
12 started_(false), 12 started_(false),
13 state_(RemoteDeviceLifeCycle::State::STOPPED) {} 13 state_(RemoteDeviceLifeCycle::State::STOPPED) {}
14 14
15 FakeRemoteDeviceLifeCycle::~FakeRemoteDeviceLifeCycle() {} 15 FakeRemoteDeviceLifeCycle::~FakeRemoteDeviceLifeCycle() {}
16 16
17 void FakeRemoteDeviceLifeCycle::Start() { 17 void FakeRemoteDeviceLifeCycle::Start() {
18 started_ = true; 18 started_ = true;
19 } 19 }
20 20
21 cryptauth::RemoteDevice FakeRemoteDeviceLifeCycle::GetRemoteDevice() const { 21 cryptauth::RemoteDevice FakeRemoteDeviceLifeCycle::GetRemoteDevice() const {
22 return remote_device_; 22 return remote_device_;
23 } 23 }
24 24
25 cryptauth::Connection* FakeRemoteDeviceLifeCycle::GetConnection() const {
26 return connection_;
27 }
28
25 RemoteDeviceLifeCycle::State FakeRemoteDeviceLifeCycle::GetState() const { 29 RemoteDeviceLifeCycle::State FakeRemoteDeviceLifeCycle::GetState() const {
26 return state_; 30 return state_;
27 } 31 }
28 32
29 Messenger* FakeRemoteDeviceLifeCycle::GetMessenger() { 33 Messenger* FakeRemoteDeviceLifeCycle::GetMessenger() {
30 return messenger_; 34 return messenger_;
31 } 35 }
32 36
33 void FakeRemoteDeviceLifeCycle::AddObserver(Observer* observer) { 37 void FakeRemoteDeviceLifeCycle::AddObserver(Observer* observer) {
34 observers_.AddObserver(observer); 38 observers_.AddObserver(observer);
35 } 39 }
36 40
37 void FakeRemoteDeviceLifeCycle::RemoveObserver(Observer* observer) { 41 void FakeRemoteDeviceLifeCycle::RemoveObserver(Observer* observer) {
38 observers_.RemoveObserver(observer); 42 observers_.RemoveObserver(observer);
39 } 43 }
40 44
41 void FakeRemoteDeviceLifeCycle::ChangeState(State new_state) { 45 void FakeRemoteDeviceLifeCycle::ChangeState(State new_state) {
42 State old_state = state_; 46 State old_state = state_;
43 state_ = new_state; 47 state_ = new_state;
44 for (auto& observer : observers_) 48 for (auto& observer : observers_)
45 observer.OnLifeCycleStateChanged(old_state, new_state); 49 observer.OnLifeCycleStateChanged(old_state, new_state);
46 } 50 }
47 51
48 } // namespace proximity_auth 52 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/fake_remote_device_life_cycle.h ('k') | components/proximity_auth/messenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698