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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 web_ui_->CallJavascriptFunction("CertificateManager.onPopulateTree", args); | 946 web_ui_->CallJavascriptFunction("CertificateManager.onPopulateTree", args); |
947 } | 947 } |
948 } | 948 } |
949 | 949 |
950 void CertificateManagerHandler::ShowError(const std::string& title, | 950 void CertificateManagerHandler::ShowError(const std::string& title, |
951 const std::string& error) const { | 951 const std::string& error) const { |
952 ScopedVector<const Value> args; | 952 ScopedVector<const Value> args; |
953 args.push_back(Value::CreateStringValue(title)); | 953 args.push_back(Value::CreateStringValue(title)); |
954 args.push_back(Value::CreateStringValue(error)); | 954 args.push_back(Value::CreateStringValue(error)); |
955 args.push_back(Value::CreateStringValue(l10n_util::GetStringUTF8(IDS_OK))); | 955 args.push_back(Value::CreateStringValue(l10n_util::GetStringUTF8(IDS_OK))); |
956 args.push_back(Value::CreateNullValue()); // cancelTitle | 956 args.push_back(base::NullValue()); // cancelTitle |
957 args.push_back(Value::CreateNullValue()); // okCallback | 957 args.push_back(base::NullValue()); // okCallback |
958 args.push_back(Value::CreateNullValue()); // cancelCallback | 958 args.push_back(base::NullValue()); // cancelCallback |
959 web_ui_->CallJavascriptFunction("AlertOverlay.show", args.get()); | 959 web_ui_->CallJavascriptFunction("AlertOverlay.show", args.get()); |
960 } | 960 } |
961 | 961 |
962 void CertificateManagerHandler::ShowImportErrors( | 962 void CertificateManagerHandler::ShowImportErrors( |
963 const std::string& title, | 963 const std::string& title, |
964 const net::CertDatabase::ImportCertFailureList& not_imported) const { | 964 const net::CertDatabase::ImportCertFailureList& not_imported) const { |
965 std::string error; | 965 std::string error; |
966 if (selected_cert_list_.size() == 1) | 966 if (selected_cert_list_.size() == 1) |
967 error = l10n_util::GetStringUTF8( | 967 error = l10n_util::GetStringUTF8( |
968 IDS_CERT_MANAGER_IMPORT_SINGLE_NOT_IMPORTED); | 968 IDS_CERT_MANAGER_IMPORT_SINGLE_NOT_IMPORTED); |
(...skipping 27 matching lines...) Expand all Loading... |
996 // TODO(xiyuan): Use async way when underlying supports it. | 996 // TODO(xiyuan): Use async way when underlying supports it. |
997 base::FundamentalValue ready(cryptohome->Pkcs11IsTpmTokenReady()); | 997 base::FundamentalValue ready(cryptohome->Pkcs11IsTpmTokenReady()); |
998 web_ui_->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", | 998 web_ui_->CallJavascriptFunction("CertificateManager.onCheckTpmTokenReady", |
999 ready); | 999 ready); |
1000 } | 1000 } |
1001 #endif | 1001 #endif |
1002 | 1002 |
1003 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1003 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
1004 return web_ui_->tab_contents()->view()->GetTopLevelNativeWindow(); | 1004 return web_ui_->tab_contents()->view()->GetTopLevelNativeWindow(); |
1005 } | 1005 } |
OLD | NEW |