| 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/cros/cert_library.h" | 5 #include "chrome/browser/chromeos/cros/cert_library.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/observer_list_threadsafe.h" | 10 #include "base/observer_list_threadsafe.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 DCHECK(request_task_.is_null()); | 126 DCHECK(request_task_.is_null()); |
| 127 net::CertDatabase::RemoveObserver(this); | 127 net::CertDatabase::RemoveObserver(this); |
| 128 } | 128 } |
| 129 | 129 |
| 130 // CertLibrary implementation. | 130 // CertLibrary implementation. |
| 131 virtual void RequestCertificates() OVERRIDE { | 131 virtual void RequestCertificates() OVERRIDE { |
| 132 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 132 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 133 | 133 |
| 134 certificates_requested_ = true; | 134 certificates_requested_ = true; |
| 135 | 135 |
| 136 if (!UserManager::Get()->user_is_logged_in()) { | 136 if (!UserManager::Get()->IsUserLoggedIn()) { |
| 137 // If we are not logged in, we cannot load any certificates. | 137 // If we are not logged in, we cannot load any certificates. |
| 138 // Set 'loaded' to true for the UI, since we are not waiting on loading. | 138 // Set 'loaded' to true for the UI, since we are not waiting on loading. |
| 139 LOG(WARNING) << "Requesting certificates before login."; | 139 LOG(WARNING) << "Requesting certificates before login."; |
| 140 certificates_loaded_ = true; | 140 certificates_loaded_ = true; |
| 141 supplemental_user_key_.reset(NULL); | 141 supplemental_user_key_.reset(NULL); |
| 142 return; | 142 return; |
| 143 } | 143 } |
| 144 | 144 |
| 145 if (!user_logged_in_) { | 145 if (!user_logged_in_) { |
| 146 user_logged_in_ = true; | 146 user_logged_in_ = true; |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 net::X509Certificate* cert = GetCertificateAt(index); | 506 net::X509Certificate* cert = GetCertificateAt(index); |
| 507 net::X509Certificate::OSCertHandle cert_handle = cert->os_cert_handle(); | 507 net::X509Certificate::OSCertHandle cert_handle = cert->os_cert_handle(); |
| 508 std::string id = x509_certificate_model::GetPkcs11Id(cert_handle); | 508 std::string id = x509_certificate_model::GetPkcs11Id(cert_handle); |
| 509 if (id == pkcs11_id) | 509 if (id == pkcs11_id) |
| 510 return index; | 510 return index; |
| 511 } | 511 } |
| 512 return -1; // Not found. | 512 return -1; // Not found. |
| 513 } | 513 } |
| 514 | 514 |
| 515 } // chromeos | 515 } // chromeos |
| OLD | NEW |