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

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

Issue 576343002: [Easy signin] Add method to get user info to easyUnlockPrivate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win fix 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
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_regular.h" 5 #include "chrome/browser/signin/easy_unlock_service_regular.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 void EasyUnlockServiceRegular::InitializeInternal() { 159 void EasyUnlockServiceRegular::InitializeInternal() {
160 registrar_.Init(profile()->GetPrefs()); 160 registrar_.Init(profile()->GetPrefs());
161 registrar_.Add( 161 registrar_.Add(
162 prefs::kEasyUnlockAllowed, 162 prefs::kEasyUnlockAllowed,
163 base::Bind(&EasyUnlockServiceRegular::OnPrefsChanged, 163 base::Bind(&EasyUnlockServiceRegular::OnPrefsChanged,
164 base::Unretained(this))); 164 base::Unretained(this)));
165 OnPrefsChanged(); 165 OnPrefsChanged();
166 } 166 }
167 167
168 void EasyUnlockServiceRegular::ShutdownInternal() {
169 turn_off_flow_.reset();
170 turn_off_flow_status_ = EasyUnlockService::IDLE;
171 registrar_.RemoveAll();
172 }
173
168 bool EasyUnlockServiceRegular::IsAllowedInternal() { 174 bool EasyUnlockServiceRegular::IsAllowedInternal() {
169 #if defined(OS_CHROMEOS) 175 #if defined(OS_CHROMEOS)
170 if (!user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) 176 if (!user_manager::UserManager::Get()->IsLoggedInAsRegularUser())
171 return false; 177 return false;
172 178
173 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile())) 179 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile()))
174 return false; 180 return false;
175 181
176 return true; 182 return true;
177 #else 183 #else
(...skipping 16 matching lines...) Expand all
194 200
195 if (!success) { 201 if (!success) {
196 SetTurnOffFlowStatus(FAIL); 202 SetTurnOffFlowStatus(FAIL);
197 return; 203 return;
198 } 204 }
199 205
200 ClearRemoteDevices(); 206 ClearRemoteDevices();
201 SetTurnOffFlowStatus(IDLE); 207 SetTurnOffFlowStatus(IDLE);
202 ReloadApp(); 208 ReloadApp();
203 } 209 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_regular.h ('k') | chrome/browser/signin/easy_unlock_service_signin_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698