| 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/ui/webui/chromeos/cryptohome_web_ui_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chromeos/dbus/cryptohome_client.h" | 9 #include "chromeos/dbus/cryptohome_client.h" |
| 10 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 cryptohome_client->TpmIsEnabled(GetCryptohomeBoolCallback("tpm-is-enabled")); | 36 cryptohome_client->TpmIsEnabled(GetCryptohomeBoolCallback("tpm-is-enabled")); |
| 37 cryptohome_client->TpmIsOwned(GetCryptohomeBoolCallback("tpm-is-owned")); | 37 cryptohome_client->TpmIsOwned(GetCryptohomeBoolCallback("tpm-is-owned")); |
| 38 cryptohome_client->TpmIsBeingOwned( | 38 cryptohome_client->TpmIsBeingOwned( |
| 39 GetCryptohomeBoolCallback("tpm-is-being-owned")); | 39 GetCryptohomeBoolCallback("tpm-is-being-owned")); |
| 40 cryptohome_client->Pkcs11IsTpmTokenReady( | 40 cryptohome_client->Pkcs11IsTpmTokenReady( |
| 41 GetCryptohomeBoolCallback("pkcs11-is-tpm-token-ready")); | 41 GetCryptohomeBoolCallback("pkcs11-is-tpm-token-ready")); |
| 42 | 42 |
| 43 BrowserThread::PostTaskAndReplyWithResult( | 43 BrowserThread::PostTaskAndReplyWithResult( |
| 44 BrowserThread::IO, | 44 BrowserThread::IO, |
| 45 FROM_HERE, | 45 FROM_HERE, |
| 46 base::Bind(&crypto::IsTPMTokenReady), | 46 base::Bind(&crypto::IsTPMTokenReady, base::Closure()), |
| 47 base::Bind(&CryptohomeWebUIHandler::DidGetNSSUtilInfoOnUIThread, | 47 base::Bind(&CryptohomeWebUIHandler::DidGetNSSUtilInfoOnUIThread, |
| 48 weak_ptr_factory_.GetWeakPtr())); | 48 weak_ptr_factory_.GetWeakPtr())); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void CryptohomeWebUIHandler::DidGetNSSUtilInfoOnUIThread( | 51 void CryptohomeWebUIHandler::DidGetNSSUtilInfoOnUIThread( |
| 52 bool is_tpm_token_ready) { | 52 bool is_tpm_token_ready) { |
| 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 54 | 54 |
| 55 base::FundamentalValue is_tpm_token_ready_value(is_tpm_token_ready); | 55 base::FundamentalValue is_tpm_token_ready_value(is_tpm_token_ready); |
| 56 SetCryptohomeProperty("is-tpm-token-ready", is_tpm_token_ready_value); | 56 SetCryptohomeProperty("is-tpm-token-ready", is_tpm_token_ready_value); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 75 | 75 |
| 76 void CryptohomeWebUIHandler::SetCryptohomeProperty( | 76 void CryptohomeWebUIHandler::SetCryptohomeProperty( |
| 77 const std::string& destination_id, | 77 const std::string& destination_id, |
| 78 const base::Value& value) { | 78 const base::Value& value) { |
| 79 base::StringValue destination_id_value(destination_id); | 79 base::StringValue destination_id_value(destination_id); |
| 80 web_ui()->CallJavascriptFunction( | 80 web_ui()->CallJavascriptFunction( |
| 81 "SetCryptohomeProperty", destination_id_value, value); | 81 "SetCryptohomeProperty", destination_id_value, value); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace chromeos | 84 } // namespace chromeos |
| OLD | NEW |