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

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 642153003: Fix a startup crash from https://crrev.com/5eb3ae10901fa65657abc902910265ab492c5dbf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ,] Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/chromeos/login/session/user_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 return; 1043 return;
1044 1044
1045 const base::ListValue* device_list = NULL; 1045 const base::ListValue* device_list = NULL;
1046 EasyUnlockService* easy_unlock_service = EasyUnlockService::GetForUser(*user); 1046 EasyUnlockService* easy_unlock_service = EasyUnlockService::GetForUser(*user);
1047 if (easy_unlock_service) { 1047 if (easy_unlock_service) {
1048 device_list = easy_unlock_service->GetRemoteDevices(); 1048 device_list = easy_unlock_service->GetRemoteDevices();
1049 easy_unlock_service->SetHardlockState( 1049 easy_unlock_service->SetHardlockState(
1050 EasyUnlockScreenlockStateHandler::NO_HARDLOCK); 1050 EasyUnlockScreenlockStateHandler::NO_HARDLOCK);
1051 } 1051 }
1052 1052
1053 EasyUnlockKeyManager* key_manager = GetEasyUnlockKeyManager();
1053 running_easy_unlock_key_ops_ = true; 1054 running_easy_unlock_key_ops_ = true;
1054 if (device_list) { 1055 if (device_list) {
1055 easy_unlock_key_manager_->RefreshKeys( 1056 key_manager->RefreshKeys(
1056 user_context, 1057 user_context,
1057 *device_list, 1058 *device_list,
1058 base::Bind(&UserSessionManager::OnEasyUnlockKeyOpsFinished, 1059 base::Bind(&UserSessionManager::OnEasyUnlockKeyOpsFinished,
1059 AsWeakPtr(), 1060 AsWeakPtr(),
1060 user_context.GetUserID())); 1061 user_context.GetUserID()));
1061 } else { 1062 } else {
1062 easy_unlock_key_manager_->RemoveKeys( 1063 key_manager->RemoveKeys(
1063 user_context, 1064 user_context,
1064 0, 1065 0,
1065 base::Bind(&UserSessionManager::OnEasyUnlockKeyOpsFinished, 1066 base::Bind(&UserSessionManager::OnEasyUnlockKeyOpsFinished,
1066 AsWeakPtr(), 1067 AsWeakPtr(),
1067 user_context.GetUserID())); 1068 user_context.GetUserID()));
1068 } 1069 }
1069 } 1070 }
1070 1071
1071 void UserSessionManager::OnEasyUnlockKeyOpsFinished( 1072 void UserSessionManager::OnEasyUnlockKeyOpsFinished(
1072 const std::string& user_id, 1073 const std::string& user_id,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1109 }
1109 1110
1110 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() { 1111 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() {
1111 if (!easy_unlock_key_manager_) 1112 if (!easy_unlock_key_manager_)
1112 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager); 1113 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager);
1113 1114
1114 return easy_unlock_key_manager_.get(); 1115 return easy_unlock_key_manager_.get();
1115 } 1116 }
1116 1117
1117 } // namespace chromeos 1118 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698