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 "chrome/browser/chromeos/login/easy_unlock/bootstrap_user_context_initi
alizer.h" | 5 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_user_context_initi
alizer.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 LOG(ERROR) << "Auth error."; | 185 LOG(ERROR) << "Auth error."; |
186 Notify(false); | 186 Notify(false); |
187 } | 187 } |
188 | 188 |
189 void BootstrapUserContextInitializer::OnNetworkError(int response_code) { | 189 void BootstrapUserContextInitializer::OnNetworkError(int response_code) { |
190 LOG(ERROR) << "Network error."; | 190 LOG(ERROR) << "Network error."; |
191 Notify(false); | 191 Notify(false); |
192 } | 192 } |
193 | 193 |
194 void BootstrapUserContextInitializer::OnScreenlockStateChanged( | 194 void BootstrapUserContextInitializer::OnScreenlockStateChanged( |
195 EasyUnlockScreenlockStateHandler::State state) { | 195 proximity_auth::ScreenlockState state) { |
196 // TODO(xiyuan): Add timeout and hook up with error UI after | 196 // TODO(xiyuan): Add timeout and hook up with error UI after |
197 // http://crbug.com/471067. | 197 // http://crbug.com/471067. |
198 if (state != EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED) | 198 if (state != proximity_auth::ScreenlockState::AUTHENTICATED) |
199 return; | 199 return; |
200 | 200 |
201 EasyUnlockService* service = | 201 EasyUnlockService* service = |
202 EasyUnlockService::Get(ProfileHelper::GetSigninProfile()); | 202 EasyUnlockService::Get(ProfileHelper::GetSigninProfile()); |
203 service->RemoveObserver(this); | 203 service->RemoveObserver(this); |
204 | 204 |
205 service->AttemptAuth( | 205 service->AttemptAuth( |
206 user_context_.GetUserID(), | 206 user_context_.GetUserID(), |
207 base::Bind(&BootstrapUserContextInitializer::OnEasyUnlockAuthenticated, | 207 base::Bind(&BootstrapUserContextInitializer::OnEasyUnlockAuthenticated, |
208 weak_ptr_factory_.GetWeakPtr())); | 208 weak_ptr_factory_.GetWeakPtr())); |
209 } | 209 } |
210 | 210 |
211 } // namespace chromeos | 211 } // namespace chromeos |
OLD | NEW |