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 21 matching lines...) Expand all Loading... | |
32 | 32 |
33 using content::BrowserThread; | 33 using content::BrowserThread; |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 static const char kKeyId[] = "id"; | 37 static const char kKeyId[] = "id"; |
38 static const char kSubNodesId[] = "subnodes"; | 38 static const char kSubNodesId[] = "subnodes"; |
39 static const char kNameId[] = "name"; | 39 static const char kNameId[] = "name"; |
40 static const char kReadOnlyId[] = "readonly"; | 40 static const char kReadOnlyId[] = "readonly"; |
41 static const char kUntrustedId[] = "untrusted"; | 41 static const char kUntrustedId[] = "untrusted"; |
42 static const char kExtractableId[] = "extractable"; | |
42 static const char kSecurityDeviceId[] = "device"; | 43 static const char kSecurityDeviceId[] = "device"; |
43 static const char kErrorId[] = "error"; | 44 static const char kErrorId[] = "error"; |
44 | 45 |
45 // Enumeration of different callers of SelectFile. (Start counting at 1 so | 46 // Enumeration of different callers of SelectFile. (Start counting at 1 so |
46 // if SelectFile is accidentally called with params=NULL it won't match any.) | 47 // if SelectFile is accidentally called with params=NULL it won't match any.) |
47 enum { | 48 enum { |
48 EXPORT_PERSONAL_FILE_SELECTED = 1, | 49 EXPORT_PERSONAL_FILE_SELECTED = 1, |
49 IMPORT_PERSONAL_FILE_SELECTED, | 50 IMPORT_PERSONAL_FILE_SELECTED, |
50 IMPORT_SERVER_FILE_SELECTED, | 51 IMPORT_SERVER_FILE_SELECTED, |
51 IMPORT_CA_FILE_SELECTED, | 52 IMPORT_CA_FILE_SELECTED, |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
968 net::X509Certificate* cert = org_cert_it->get(); | 969 net::X509Certificate* cert = org_cert_it->get(); |
969 cert_dict->SetString(kKeyId, CertToId(*cert)); | 970 cert_dict->SetString(kKeyId, CertToId(*cert)); |
970 cert_dict->SetString(kNameId, certificate_manager_model_->GetColumnText( | 971 cert_dict->SetString(kNameId, certificate_manager_model_->GetColumnText( |
971 *cert, CertificateManagerModel::COL_SUBJECT_NAME)); | 972 *cert, CertificateManagerModel::COL_SUBJECT_NAME)); |
972 cert_dict->SetBoolean( | 973 cert_dict->SetBoolean( |
973 kReadOnlyId, | 974 kReadOnlyId, |
974 certificate_manager_model_->cert_db().IsReadOnly(cert)); | 975 certificate_manager_model_->cert_db().IsReadOnly(cert)); |
975 cert_dict->SetBoolean( | 976 cert_dict->SetBoolean( |
976 kUntrustedId, | 977 kUntrustedId, |
977 certificate_manager_model_->cert_db().IsUntrusted(cert)); | 978 certificate_manager_model_->cert_db().IsUntrusted(cert)); |
979 cert_dict->SetBoolean( | |
980 kExtractableId, | |
981 !certificate_manager_model_->IsHardwareBacked(cert)); | |
wtc
2012/05/22 23:43:46
Please add a TODO comment to note that this should
hshi1
2012/05/23 00:03:29
Done.
| |
978 // TODO(mattm): Other columns. | 982 // TODO(mattm): Other columns. |
979 subnodes->Append(cert_dict); | 983 subnodes->Append(cert_dict); |
980 } | 984 } |
981 std::sort(subnodes->begin(), subnodes->end(), comparator); | 985 std::sort(subnodes->begin(), subnodes->end(), comparator); |
982 | 986 |
983 dict->Set(kSubNodesId, subnodes); | 987 dict->Set(kSubNodesId, subnodes); |
984 nodes->Append(dict); | 988 nodes->Append(dict); |
985 } | 989 } |
986 std::sort(nodes->begin(), nodes->end(), comparator); | 990 std::sort(nodes->begin(), nodes->end(), comparator); |
987 | 991 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1050 web_ui()->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", | 1054 web_ui()->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", |
1051 ready); | 1055 ready); |
1052 } | 1056 } |
1053 #endif | 1057 #endif |
1054 | 1058 |
1055 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1059 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
1056 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(); | 1060 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(); |
1057 } | 1061 } |
1058 | 1062 |
1059 } // namespace options2 | 1063 } // namespace options2 |
OLD | NEW |