OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/managed/managed_user_authenticator.h" | 5 #include "chrome/browser/chromeos/login/managed/managed_user_authenticator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/chromeos/boot_times_loader.h" | 10 #include "chrome/browser/chromeos/boot_times_loader.h" |
11 #include "chrome/browser/chromeos/login/parallel_authenticator.h" | 11 #include "chrome/browser/chromeos/login/parallel_authenticator.h" |
12 #include "chromeos/cryptohome/async_method_caller.h" | 12 #include "chromeos/cryptohome/async_method_caller.h" |
13 #include "chromeos/cryptohome/system_salt_getter.h" | 13 #include "chromeos/cryptohome/system_salt_getter.h" |
14 #include "chromeos/dbus/cryptohome_client.h" | 14 #include "chromeos/dbus/cryptohome_client.h" |
15 #include "chromeos/dbus/dbus_thread_manager.h" | 15 #include "chromeos/dbus/dbus_thread_manager.h" |
16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
17 #include "crypto/sha2.h" | 17 #include "crypto/sha2.h" |
18 #include "google_apis/gaia/gaia_auth_util.h" | 18 #include "google_apis/gaia/gaia_auth_util.h" |
19 #include "third_party/cros_system_api/dbus/service_constants.h" | 19 #include "third_party/cros_system_api/dbus/service_constants.h" |
20 | 20 |
21 using content::BrowserThread; | 21 using content::BrowserThread; |
22 | 22 |
23 namespace chromeos { | 23 namespace chromeos { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 // Milliseconds until we timeout our attempt to hit ClientLogin. | |
28 const int kClientLoginTimeoutMs = 10000; | |
29 | |
30 // Records status and calls resolver->Resolve(). | 27 // Records status and calls resolver->Resolve(). |
31 void TriggerResolve(ManagedUserAuthenticator::AuthAttempt* attempt, | 28 void TriggerResolve(ManagedUserAuthenticator::AuthAttempt* attempt, |
32 scoped_refptr<ManagedUserAuthenticator> resolver, | 29 scoped_refptr<ManagedUserAuthenticator> resolver, |
33 bool success, | 30 bool success, |
34 cryptohome::MountError return_code) { | 31 cryptohome::MountError return_code) { |
35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 32 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
36 attempt->RecordCryptohomeStatus(success, return_code); | 33 attempt->RecordCryptohomeStatus(success, return_code); |
37 resolver->Resolve(); | 34 resolver->Resolve(); |
38 } | 35 } |
39 | 36 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 320 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
324 return hash_obtained_; | 321 return hash_obtained_; |
325 } | 322 } |
326 | 323 |
327 std::string ManagedUserAuthenticator::AuthAttempt::hash() { | 324 std::string ManagedUserAuthenticator::AuthAttempt::hash() { |
328 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 325 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
329 return hash_; | 326 return hash_; |
330 } | 327 } |
331 | 328 |
332 } // namespace chromeos | 329 } // namespace chromeos |
OLD | NEW |