| Index: chrome/browser/ui/webui/about_ui.cc
|
| diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
|
| index dce2385fce834b6ba6cb23131b04ef8a66640009..4d4376948bce0416fe4aa7d61fda1e55db3f4295 100644
|
| --- a/chrome/browser/ui/webui/about_ui.cc
|
| +++ b/chrome/browser/ui/webui/about_ui.cc
|
| @@ -55,7 +55,6 @@
|
| #include "content/public/browser/web_ui.h"
|
| #include "content/public/common/content_client.h"
|
| #include "content/public/common/process_type.h"
|
| -#include "crypto/nss_util.h"
|
| #include "googleurl/src/gurl.h"
|
| #include "grit/browser_resources.h"
|
| #include "grit/chromium_strings.h"
|
| @@ -82,14 +81,11 @@
|
|
|
| #if defined(OS_CHROMEOS)
|
| #include "chrome/browser/chromeos/cros/cros_library.h"
|
| -#include "chrome/browser/chromeos/cros/cryptohome_library.h"
|
| #include "chrome/browser/chromeos/cros/network_library.h"
|
| #include "chrome/browser/chromeos/customization_document.h"
|
| #include "chrome/browser/chromeos/login/wizard_controller.h"
|
| #include "chrome/browser/chromeos/oom_priority_manager.h"
|
| #include "chrome/browser/chromeos/version_loader.h"
|
| -#include "chromeos/dbus/cryptohome_client.h"
|
| -#include "chromeos/dbus/dbus_thread_manager.h"
|
| #endif
|
|
|
| #if defined(USE_ASH)
|
| @@ -506,13 +502,6 @@ std::string AboutNetwork(const std::string& query) {
|
| return GetNetworkHtmlInfo(refresh);
|
| }
|
|
|
| -std::string AddBoolRow(const std::string& name, bool value) {
|
| - std::string row;
|
| - row.append(WrapWithTD(name));
|
| - row.append(WrapWithTD(value ? "true" : "false"));
|
| - return WrapWithTR(row);
|
| -}
|
| -
|
| std::string AddStringRow(const std::string& name, const std::string& value) {
|
| std::string row;
|
| row.append(WrapWithTD(name));
|
| @@ -520,122 +509,6 @@ std::string AddStringRow(const std::string& name, const std::string& value) {
|
| return WrapWithTR(row);
|
| }
|
|
|
| -class CryptohomeDataRequest : public base::RefCounted<CryptohomeDataRequest> {
|
| - public:
|
| - CryptohomeDataRequest(scoped_refptr<AboutUIHTMLSource> source,
|
| - const std::string& query,
|
| - int request_id)
|
| - : source_(source),
|
| - query_(query),
|
| - request_id_(request_id),
|
| - num_pending_values_(0),
|
| - is_mounted_(false),
|
| - tpm_is_ready_(false),
|
| - tpm_is_enabled_(false),
|
| - tpm_is_owned_(false),
|
| - tpm_is_being_owned_(false),
|
| - is_tpm_token_ready_(false) {
|
| - }
|
| -
|
| - // Starts asynchronous value fetching to finish data request.
|
| - void Start() {
|
| - // Request bool values asynchronously.
|
| - RequestBoolProperty(&chromeos::CryptohomeClient::TpmIsReady,
|
| - &tpm_is_ready_);
|
| - RequestBoolProperty(&chromeos::CryptohomeClient::Pkcs11IsTpmTokenReady,
|
| - &is_tpm_token_ready_);
|
| -
|
| - // TODO(hashimoto): Get these values asynchronously. crbug.com/126674
|
| - chromeos::CryptohomeLibrary* cryptohome_library =
|
| - chromeos::CrosLibrary::Get()->GetCryptohomeLibrary();
|
| - is_mounted_ = cryptohome_library->IsMounted();
|
| - tpm_is_enabled_ = cryptohome_library->TpmIsEnabled();
|
| - tpm_is_owned_ = cryptohome_library->TpmIsOwned();
|
| - tpm_is_being_owned_ = cryptohome_library->TpmIsBeingOwned();
|
| - }
|
| -
|
| - private:
|
| - // Member function pointer to CryptohomeClient's bool value getter.
|
| - typedef void (chromeos::CryptohomeClient::*CryptohomeBoolGetterMethod)(
|
| - const chromeos::CryptohomeClient::BoolMethodCallback&);
|
| -
|
| - ~CryptohomeDataRequest() {}
|
| -
|
| - // Requests Cryptohome's bool property. OnBoolValueReceived will be called.
|
| - void RequestBoolProperty(CryptohomeBoolGetterMethod getter,
|
| - bool* destination) {
|
| - ++num_pending_values_;
|
| - (chromeos::DBusThreadManager::Get()->GetCryptohomeClient()->*getter)(
|
| - base::Bind(&CryptohomeDataRequest::OnBoolValueReceived,
|
| - this,
|
| - destination));
|
| - }
|
| -
|
| - // Called when a bool property is received. This method finishes data request
|
| - // when there is no pending values to be received.
|
| - void OnBoolValueReceived(bool* destination,
|
| - chromeos::DBusMethodCallStatus call_status,
|
| - bool value) {
|
| - if (call_status == chromeos::DBUS_METHOD_CALL_SUCCESS)
|
| - *destination = value;
|
| - if (--num_pending_values_ == 0)
|
| - Finish();
|
| - }
|
| -
|
| - // Finishes data request.
|
| - void Finish() {
|
| - int refresh = 0;
|
| - base::StringToInt(query_, &refresh);
|
| -
|
| - std::string output;
|
| - AppendHeader(&output, refresh, "About Cryptohome");
|
| - AppendBody(&output);
|
| - AppendRefresh(&output, refresh, "cryptohome");
|
| -
|
| - output.append("<h3>CryptohomeLibrary:</h3>");
|
| - output.append("<table>");
|
| - output.append(AddBoolRow("IsMounted", is_mounted_));
|
| - output.append(AddBoolRow("TpmIsReady", tpm_is_ready_));
|
| - output.append(AddBoolRow("TpmIsEnabled", tpm_is_enabled_));
|
| - output.append(AddBoolRow("TpmIsOwned", tpm_is_owned_));
|
| - output.append(AddBoolRow("TpmIsBeingOwned", tpm_is_being_owned_));
|
| - output.append(AddBoolRow("Pkcs11IsTpmTokenReady", is_tpm_token_ready_));
|
| - output.append("</table>");
|
| -
|
| - output.append("<h3>crypto:</h3>");
|
| - output.append("<table>");
|
| - output.append(AddBoolRow("IsTPMTokenReady", crypto::IsTPMTokenReady()));
|
| - std::string token_name, user_pin;
|
| - if (crypto::IsTPMTokenReady())
|
| - crypto::GetTPMTokenInfo(&token_name, &user_pin);
|
| - output.append(AddStringRow("token_name", token_name));
|
| - output.append(
|
| - AddStringRow("user_pin", std::string(user_pin.length(), '*')));
|
| - output.append("</table>");
|
| - AppendFooter(&output);
|
| -
|
| - source_->FinishDataRequest(output, request_id_);
|
| - }
|
| -
|
| - // Data request parameters.
|
| - scoped_refptr<AboutUIHTMLSource> source_;
|
| - std::string query_;
|
| - int request_id_;
|
| -
|
| - // Number of pending values to be received.
|
| - int num_pending_values_;
|
| -
|
| - // Bool values to be appended to the output.
|
| - bool is_mounted_;
|
| - bool tpm_is_ready_;
|
| - bool tpm_is_enabled_;
|
| - bool tpm_is_owned_;
|
| - bool tpm_is_being_owned_;
|
| - bool is_tpm_token_ready_;
|
| -
|
| - friend class base::RefCounted<CryptohomeDataRequest>;
|
| -};
|
| -
|
| std::string AboutDiscardsRun() {
|
| std::string output;
|
| AppendHeader(&output, 0, "About discards");
|
| @@ -1427,11 +1300,6 @@ void AboutUIHTMLSource::StartDataRequest(const std::string& path,
|
| response = ResourceBundle::GetSharedInstance().GetRawDataResource(
|
| idr, ui::SCALE_FACTOR_NONE).as_string();
|
| #if defined(OS_CHROMEOS)
|
| - } else if (host == chrome::kChromeUICryptohomeHost) {
|
| - scoped_refptr<CryptohomeDataRequest> request(
|
| - new CryptohomeDataRequest(this, path, request_id));
|
| - request->Start();
|
| - return;
|
| } else if (host == chrome::kChromeUIDiscardsHost) {
|
| response = AboutDiscards(path);
|
| #endif
|
|
|