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

Side by Side Diff: chrome/browser/signin/easy_unlock_service_signin_chromeos.cc

Issue 889153004: [Cleanup] Clean up Easy Unlock code a bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and remove TODOs Created 5 years, 10 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 "chrome/browser/signin/easy_unlock_service_signin_chromeos.h" 5 #include "chrome/browser/signin/easy_unlock_service_signin_chromeos.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 return; 277 return;
278 service_active_ = false; 278 service_active_ = false;
279 279
280 weak_ptr_factory_.InvalidateWeakPtrs(); 280 weak_ptr_factory_.InvalidateWeakPtrs();
281 ScreenlockBridge::Get()->RemoveObserver(this); 281 ScreenlockBridge::Get()->RemoveObserver(this);
282 chromeos::LoginState::Get()->RemoveObserver(this); 282 chromeos::LoginState::Get()->RemoveObserver(this);
283 STLDeleteContainerPairSecondPointers(user_data_.begin(), user_data_.end()); 283 STLDeleteContainerPairSecondPointers(user_data_.begin(), user_data_.end());
284 user_data_.clear(); 284 user_data_.clear();
285 } 285 }
286 286
287 bool EasyUnlockServiceSignin::IsAllowedInternal() { 287 bool EasyUnlockServiceSignin::IsAllowedInternal() const {
288 return service_active_ && 288 return service_active_ &&
289 !user_id_.empty() && 289 !user_id_.empty() &&
290 !chromeos::LoginState::Get()->IsUserLoggedIn(); 290 !chromeos::LoginState::Get()->IsUserLoggedIn();
291 } 291 }
292 292
293 void EasyUnlockServiceSignin::OnScreenDidLock() { 293 void EasyUnlockServiceSignin::OnScreenDidLock() {
294 // Update initial UI is when the account picker on login screen is ready. 294 // Update initial UI is when the account picker on login screen is ready.
295 ShowInitialUserState(); 295 ShowInitialUserState();
296 } 296 }
297 297
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 return NULL; 388 return NULL;
389 389
390 std::map<std::string, UserData*>::const_iterator it = 390 std::map<std::string, UserData*>::const_iterator it =
391 user_data_.find(user_id_); 391 user_data_.find(user_id_);
392 if (it == user_data_.end()) 392 if (it == user_data_.end())
393 return NULL; 393 return NULL;
394 if (it->second->state != USER_DATA_STATE_LOADED) 394 if (it->second->state != USER_DATA_STATE_LOADED)
395 return NULL; 395 return NULL;
396 return it->second; 396 return it->second;
397 } 397 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698