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

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

Issue 1372283002: Hook up ProximityAuthSystem in EasyUnlockService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth_connection
Patch Set: 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
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/screenlock_bridge.h" 5 #include "components/proximity_auth/screenlock_bridge.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 9
10 #if defined(OS_CHROMEOS) 10 #if defined(OS_CHROMEOS)
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 FOR_EACH_OBSERVER(Observer, observers_, OnScreenDidUnlock(screen_type)); 138 FOR_EACH_OBSERVER(Observer, observers_, OnScreenDidUnlock(screen_type));
139 } 139 }
140 140
141 void ScreenlockBridge::SetFocusedUser(const std::string& user_id) { 141 void ScreenlockBridge::SetFocusedUser(const std::string& user_id) {
142 if (user_id == focused_user_id_) 142 if (user_id == focused_user_id_)
143 return; 143 return;
144 focused_user_id_ = user_id; 144 focused_user_id_ = user_id;
145 FOR_EACH_OBSERVER(Observer, observers_, OnFocusedUserChanged(user_id)); 145 FOR_EACH_OBSERVER(Observer, observers_, OnFocusedUserChanged(user_id));
146 } 146 }
147 147
148 std::string ScreenlockBridge::GetFocusedUser() {
149 return focused_user_id_;
150 }
151
148 bool ScreenlockBridge::IsLocked() const { 152 bool ScreenlockBridge::IsLocked() const {
149 return lock_handler_ != nullptr; 153 return lock_handler_ != nullptr;
150 } 154 }
151 155
152 void ScreenlockBridge::Lock() { 156 void ScreenlockBridge::Lock() {
153 #if defined(OS_CHROMEOS) 157 #if defined(OS_CHROMEOS)
154 chromeos::SessionManagerClient* session_manager = 158 chromeos::SessionManagerClient* session_manager =
155 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(); 159 chromeos::DBusThreadManager::Get()->GetSessionManagerClient();
156 session_manager->RequestLockScreen(); 160 session_manager->RequestLockScreen();
157 #else 161 #else
(...skipping 14 matching lines...) Expand all
172 observers_.RemoveObserver(observer); 176 observers_.RemoveObserver(observer);
173 } 177 }
174 178
175 ScreenlockBridge::ScreenlockBridge() : lock_handler_(nullptr) { 179 ScreenlockBridge::ScreenlockBridge() : lock_handler_(nullptr) {
176 } 180 }
177 181
178 ScreenlockBridge::~ScreenlockBridge() { 182 ScreenlockBridge::~ScreenlockBridge() {
179 } 183 }
180 184
181 } // namespace proximity_auth 185 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698