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/options/certificate_manager_handler.h" | 5 #include "chrome/browser/ui/webui/options/certificate_manager_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 subnodes->Append(cert_dict); | 1007 subnodes->Append(cert_dict); |
1008 } | 1008 } |
1009 std::sort(subnodes->begin(), subnodes->end(), comparator); | 1009 std::sort(subnodes->begin(), subnodes->end(), comparator); |
1010 | 1010 |
1011 dict->Set(kSubNodesId, subnodes); | 1011 dict->Set(kSubNodesId, subnodes); |
1012 nodes->Append(dict); | 1012 nodes->Append(dict); |
1013 } | 1013 } |
1014 std::sort(nodes->begin(), nodes->end(), comparator); | 1014 std::sort(nodes->begin(), nodes->end(), comparator); |
1015 | 1015 |
1016 ListValue args; | 1016 ListValue args; |
1017 args.Append(Value::CreateStringValue(tree_name)); | 1017 args.Append(new base::StringValue(tree_name)); |
1018 args.Append(nodes); | 1018 args.Append(nodes); |
1019 web_ui()->CallJavascriptFunction("CertificateManager.onPopulateTree", args); | 1019 web_ui()->CallJavascriptFunction("CertificateManager.onPopulateTree", args); |
1020 } | 1020 } |
1021 } | 1021 } |
1022 | 1022 |
1023 void CertificateManagerHandler::ShowError(const std::string& title, | 1023 void CertificateManagerHandler::ShowError(const std::string& title, |
1024 const std::string& error) const { | 1024 const std::string& error) const { |
1025 ScopedVector<const Value> args; | 1025 ScopedVector<const Value> args; |
1026 args.push_back(Value::CreateStringValue(title)); | 1026 args.push_back(new base::StringValue(title)); |
1027 args.push_back(Value::CreateStringValue(error)); | 1027 args.push_back(new base::StringValue(error)); |
1028 args.push_back(Value::CreateStringValue(l10n_util::GetStringUTF8(IDS_OK))); | 1028 args.push_back(new base::StringValue(l10n_util::GetStringUTF8(IDS_OK))); |
1029 args.push_back(Value::CreateNullValue()); // cancelTitle | 1029 args.push_back(Value::CreateNullValue()); // cancelTitle |
1030 args.push_back(Value::CreateNullValue()); // okCallback | 1030 args.push_back(Value::CreateNullValue()); // okCallback |
1031 args.push_back(Value::CreateNullValue()); // cancelCallback | 1031 args.push_back(Value::CreateNullValue()); // cancelCallback |
1032 web_ui()->CallJavascriptFunction("AlertOverlay.show", args.get()); | 1032 web_ui()->CallJavascriptFunction("AlertOverlay.show", args.get()); |
1033 } | 1033 } |
1034 | 1034 |
1035 void CertificateManagerHandler::ShowImportErrors( | 1035 void CertificateManagerHandler::ShowImportErrors( |
1036 const std::string& title, | 1036 const std::string& title, |
1037 const net::NSSCertDatabase::ImportCertFailureList& not_imported) const { | 1037 const net::NSSCertDatabase::ImportCertFailureList& not_imported) const { |
1038 std::string error; | 1038 std::string error; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 web_ui()->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", | 1078 web_ui()->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", |
1079 ready); | 1079 ready); |
1080 } | 1080 } |
1081 #endif | 1081 #endif |
1082 | 1082 |
1083 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1083 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
1084 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(); | 1084 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(); |
1085 } | 1085 } |
1086 | 1086 |
1087 } // namespace options | 1087 } // namespace options |
OLD | NEW |