OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/options/certificate_manager_handler.h" | 5 #include "chrome/browser/ui/webui/options/certificate_manager_handler.h" |
6 | 6 |
7 #include "base/file_util.h" // for FileAccessProvider | 7 #include "base/file_util.h" // for FileAccessProvider |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/safe_strerror_posix.h" | 9 #include "base/safe_strerror_posix.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 void CertificateManagerHandler::GetCATrust(const ListValue* args) { | 460 void CertificateManagerHandler::GetCATrust(const ListValue* args) { |
461 net::X509Certificate* cert = CallbackArgsToCert(args); | 461 net::X509Certificate* cert = CallbackArgsToCert(args); |
462 if (!cert) { | 462 if (!cert) { |
463 web_ui_->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss"); | 463 web_ui_->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss"); |
464 return; | 464 return; |
465 } | 465 } |
466 | 466 |
467 int trust = certificate_manager_model_->cert_db().GetCertTrust( | 467 int trust = certificate_manager_model_->cert_db().GetCertTrust( |
468 cert, net::CA_CERT); | 468 cert, net::CA_CERT); |
| 469 using base::FundamentalValue; |
469 FundamentalValue ssl_value(bool(trust & net::CertDatabase::TRUSTED_SSL)); | 470 FundamentalValue ssl_value(bool(trust & net::CertDatabase::TRUSTED_SSL)); |
470 FundamentalValue email_value(bool(trust & net::CertDatabase::TRUSTED_EMAIL)); | 471 FundamentalValue email_value(bool(trust & net::CertDatabase::TRUSTED_EMAIL)); |
471 FundamentalValue obj_sign_value( | 472 FundamentalValue obj_sign_value( |
472 bool(trust & net::CertDatabase::TRUSTED_OBJ_SIGN)); | 473 bool(trust & net::CertDatabase::TRUSTED_OBJ_SIGN)); |
473 web_ui_->CallJavascriptFunction( | 474 web_ui_->CallJavascriptFunction( |
474 "CertificateEditCaTrustOverlay.populateTrust", | 475 "CertificateEditCaTrustOverlay.populateTrust", |
475 ssl_value, email_value, obj_sign_value); | 476 ssl_value, email_value, obj_sign_value); |
476 } | 477 } |
477 | 478 |
478 void CertificateManagerHandler::EditCATrust(const ListValue* args) { | 479 void CertificateManagerHandler::EditCATrust(const ListValue* args) { |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 error_value, | 987 error_value, |
987 cert_error_list); | 988 cert_error_list); |
988 } | 989 } |
989 | 990 |
990 #if defined(OS_CHROMEOS) | 991 #if defined(OS_CHROMEOS) |
991 void CertificateManagerHandler::CheckTpmTokenReady(const ListValue* args) { | 992 void CertificateManagerHandler::CheckTpmTokenReady(const ListValue* args) { |
992 chromeos::CryptohomeLibrary* cryptohome = | 993 chromeos::CryptohomeLibrary* cryptohome = |
993 chromeos::CrosLibrary::Get()->GetCryptohomeLibrary(); | 994 chromeos::CrosLibrary::Get()->GetCryptohomeLibrary(); |
994 | 995 |
995 // TODO(xiyuan): Use async way when underlying supports it. | 996 // TODO(xiyuan): Use async way when underlying supports it. |
996 FundamentalValue ready(cryptohome->Pkcs11IsTpmTokenReady()); | 997 base::FundamentalValue ready(cryptohome->Pkcs11IsTpmTokenReady()); |
997 web_ui_->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", | 998 web_ui_->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", |
998 ready); | 999 ready); |
999 } | 1000 } |
1000 #endif | 1001 #endif |
1001 | 1002 |
1002 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1003 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
1003 return web_ui_->tab_contents()->view()->GetTopLevelNativeWindow(); | 1004 return web_ui_->tab_contents()->view()->GetTopLevelNativeWindow(); |
1004 } | 1005 } |
OLD | NEW |