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/options2/certificate_manager_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/certificate_manager_handler2.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/file_util.h" // for FileAccessProvider | 9 #include "base/file_util.h" // for FileAccessProvider |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 net::X509Certificate* cert = org_cert_it->get(); | 969 net::X509Certificate* cert = org_cert_it->get(); |
970 cert_dict->SetString(kKeyId, CertToId(*cert)); | 970 cert_dict->SetString(kKeyId, CertToId(*cert)); |
971 cert_dict->SetString(kNameId, certificate_manager_model_->GetColumnText( | 971 cert_dict->SetString(kNameId, certificate_manager_model_->GetColumnText( |
972 *cert, CertificateManagerModel::COL_SUBJECT_NAME)); | 972 *cert, CertificateManagerModel::COL_SUBJECT_NAME)); |
973 cert_dict->SetBoolean( | 973 cert_dict->SetBoolean( |
974 kReadOnlyId, | 974 kReadOnlyId, |
975 certificate_manager_model_->cert_db().IsReadOnly(cert)); | 975 certificate_manager_model_->cert_db().IsReadOnly(cert)); |
976 cert_dict->SetBoolean( | 976 cert_dict->SetBoolean( |
977 kUntrustedId, | 977 kUntrustedId, |
978 certificate_manager_model_->cert_db().IsUntrusted(cert)); | 978 certificate_manager_model_->cert_db().IsUntrusted(cert)); |
| 979 // TODO(hshi): This should be determined by testing for PKCS #11 |
| 980 // CKA_EXTRACTABLE attribute. We may need to use the NSS function |
| 981 // PK11_ReadRawAttribute to do that. |
979 cert_dict->SetBoolean( | 982 cert_dict->SetBoolean( |
980 kExtractableId, | 983 kExtractableId, |
981 !certificate_manager_model_->IsHardwareBacked(cert)); | 984 !certificate_manager_model_->IsHardwareBacked(cert)); |
982 // TODO(mattm): Other columns. | 985 // TODO(mattm): Other columns. |
983 subnodes->Append(cert_dict); | 986 subnodes->Append(cert_dict); |
984 } | 987 } |
985 std::sort(subnodes->begin(), subnodes->end(), comparator); | 988 std::sort(subnodes->begin(), subnodes->end(), comparator); |
986 | 989 |
987 dict->Set(kSubNodesId, subnodes); | 990 dict->Set(kSubNodesId, subnodes); |
988 nodes->Append(dict); | 991 nodes->Append(dict); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 web_ui()->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", | 1057 web_ui()->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", |
1055 ready); | 1058 ready); |
1056 } | 1059 } |
1057 #endif | 1060 #endif |
1058 | 1061 |
1059 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1062 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
1060 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(); | 1063 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(); |
1061 } | 1064 } |
1062 | 1065 |
1063 } // namespace options2 | 1066 } // namespace options2 |
OLD | NEW |