Index: chrome/browser/chromeos/cros/cert_library.cc |
diff --git a/chrome/browser/chromeos/cros/cert_library.cc b/chrome/browser/chromeos/cros/cert_library.cc |
index a5cade12441dbe0a919cd72e5a141f74999d2197..65518af9c5d9d9671888e204eaa69bc9761948e1 100644 |
--- a/chrome/browser/chromeos/cros/cert_library.cc |
+++ b/chrome/browser/chromeos/cros/cert_library.cc |
@@ -108,13 +108,14 @@ class CertLibraryImpl |
public: |
typedef ObserverListThreadSafe<CertLibrary::Observer> CertLibraryObserverList; |
- CertLibraryImpl() : |
+ explicit CertLibraryImpl(bool stub) : |
observer_list_(new CertLibraryObserverList), |
tpm_token_ready_(false), |
user_logged_in_(false), |
certificates_requested_(false), |
certificates_loaded_(false), |
key_store_loaded_(false), |
+ is_stub_mode_(stub), |
ALLOW_THIS_IN_INITIALIZER_LIST(certs_(this)), |
ALLOW_THIS_IN_INITIALIZER_LIST(user_certs_(this)), |
ALLOW_THIS_IN_INITIALIZER_LIST(server_certs_(this)), |
@@ -154,7 +155,7 @@ class CertLibraryImpl |
// make sure that that case still works. |
if (CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kLoadOpencryptoki) || |
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kStubCros)) { |
+ is_stub_mode_) { |
stevenjb
2012/06/20 17:26:47
This really shouldn't be tied to stub_mode, it sho
hashimoto
2012/06/21 06:20:59
Done.
|
crypto::EnableTPMTokenForNSS(); |
// Note: this calls crypto::EnsureTPMTokenReady() |
RequestCertificates(); |
@@ -509,6 +510,9 @@ class CertLibraryImpl |
// "safe-mode". |
bool key_store_loaded_; |
+ // True when stub implementation is required. |
+ bool is_stub_mode_; |
+ |
// Certificates. |
CertList certs_; |
CertList user_certs_; |
@@ -527,8 +531,7 @@ CertLibrary::~CertLibrary() { |
// static |
CertLibrary* CertLibrary::GetImpl(bool stub) { |
- // No libcros dependencies, so always return CertLibraryImpl() (no stub). |
- return new CertLibraryImpl(); |
+ return new CertLibraryImpl(stub); |
} |
////////////////////////////////////////////////////////////////////////////// |