| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // windows.h must be first otherwise Win8 SDK breaks. | 5 // windows.h must be first otherwise Win8 SDK breaks. |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #include <LM.h> | 7 #include <LM.h> |
| 8 #include <wincred.h> | 8 #include <wincred.h> |
| 9 | 9 |
| 10 // SECURITY_WIN32 must be defined in order to get | 10 // SECURITY_WIN32 must be defined in order to get |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 OsPasswordStatus* retVal) { | 175 OsPasswordStatus* retVal) { |
| 176 PrefService* local_state = g_browser_process->local_state(); | 176 PrefService* local_state = g_browser_process->local_state(); |
| 177 prefs->Write(local_state); | 177 prefs->Write(local_state); |
| 178 reply.Run(*retVal); | 178 reply.Run(*retVal); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace | 181 } // namespace |
| 182 | 182 |
| 183 void GetOsPasswordStatus(const base::Callback<void(OsPasswordStatus)>& reply) { | 183 void GetOsPasswordStatus(const base::Callback<void(OsPasswordStatus)>& reply) { |
| 184 // Preferences can be accessed on the UI thread only. | 184 // Preferences can be accessed on the UI thread only. |
| 185 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 185 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 186 PrefService* local_state = g_browser_process->local_state(); | 186 PrefService* local_state = g_browser_process->local_state(); |
| 187 PasswordCheckPrefs* prefs = new PasswordCheckPrefs; | 187 PasswordCheckPrefs* prefs = new PasswordCheckPrefs; |
| 188 prefs->Read(local_state); | 188 prefs->Read(local_state); |
| 189 OsPasswordStatus* retVal = new OsPasswordStatus(PASSWORD_STATUS_UNKNOWN); | 189 OsPasswordStatus* retVal = new OsPasswordStatus(PASSWORD_STATUS_UNKNOWN); |
| 190 bool posted = base::WorkerPool::PostTaskAndReply( | 190 bool posted = base::WorkerPool::PostTaskAndReply( |
| 191 FROM_HERE, | 191 FROM_HERE, |
| 192 base::Bind(&GetOsPasswordStatusInternal, | 192 base::Bind(&GetOsPasswordStatusInternal, |
| 193 base::Unretained(prefs), base::Unretained(retVal)), | 193 base::Unretained(prefs), base::Unretained(retVal)), |
| 194 base::Bind(&ReplyOsPasswordStatus, | 194 base::Bind(&ReplyOsPasswordStatus, |
| 195 reply, base::Owned(prefs), base::Owned(retVal)), | 195 reply, base::Owned(prefs), base::Owned(retVal)), |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 SecureZeroMemory(password, sizeof(password)); | 293 SecureZeroMemory(password, sizeof(password)); |
| 294 } | 294 } |
| 295 } while (credErr == NO_ERROR && | 295 } while (credErr == NO_ERROR && |
| 296 (retval == false && tries < kMaxPasswordRetries)); | 296 (retval == false && tries < kMaxPasswordRetries)); |
| 297 return retval; | 297 return retval; |
| 298 } | 298 } |
| 299 | 299 |
| 300 } // namespace password_manager_util | 300 } // namespace password_manager_util |
| OLD | NEW |