OLD | NEW |
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/screenlock_bridge.h" | 5 #include "components/proximity_auth/screenlock_bridge.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "components/proximity_auth/logging/logging.h" | 9 #include "components/proximity_auth/logging/logging.h" |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 observer.OnScreenDidLock(screen_type); | 139 observer.OnScreenDidLock(screen_type); |
140 } else { | 140 } else { |
141 for (auto& observer : observers_) | 141 for (auto& observer : observers_) |
142 observer.OnScreenDidUnlock(screen_type); | 142 observer.OnScreenDidUnlock(screen_type); |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 void ScreenlockBridge::SetFocusedUser(const AccountId& account_id) { | 146 void ScreenlockBridge::SetFocusedUser(const AccountId& account_id) { |
147 if (account_id == focused_account_id_) | 147 if (account_id == focused_account_id_) |
148 return; | 148 return; |
149 PA_LOG(INFO) << "Focused user changed to " << account_id.Serialize(); | |
150 focused_account_id_ = account_id; | 149 focused_account_id_ = account_id; |
151 for (auto& observer : observers_) | 150 for (auto& observer : observers_) |
152 observer.OnFocusedUserChanged(account_id); | 151 observer.OnFocusedUserChanged(account_id); |
153 } | 152 } |
154 | 153 |
155 bool ScreenlockBridge::IsLocked() const { | 154 bool ScreenlockBridge::IsLocked() const { |
156 return lock_handler_ != nullptr; | 155 return lock_handler_ != nullptr; |
157 } | 156 } |
158 | 157 |
159 void ScreenlockBridge::Lock() { | 158 void ScreenlockBridge::Lock() { |
(...skipping 19 matching lines...) Expand all Loading... |
179 observers_.RemoveObserver(observer); | 178 observers_.RemoveObserver(observer); |
180 } | 179 } |
181 | 180 |
182 ScreenlockBridge::ScreenlockBridge() | 181 ScreenlockBridge::ScreenlockBridge() |
183 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {} | 182 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {} |
184 | 183 |
185 ScreenlockBridge::~ScreenlockBridge() { | 184 ScreenlockBridge::~ScreenlockBridge() { |
186 } | 185 } |
187 | 186 |
188 } // namespace proximity_auth | 187 } // namespace proximity_auth |
OLD | NEW |