Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/dom_ui/options/certificate_manager_handler.cc

Issue 6277001: Fix error dialog in certificate manager missing ok button. Fix leak. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/dom_ui/options/certificate_manager_handler.h" 5 #include "chrome/browser/dom_ui/options/certificate_manager_handler.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/l10n_util_collator.h" 8 #include "app/l10n_util_collator.h"
9 #include "base/file_util.h" // for FileAccessProvider 9 #include "base/file_util.h" // for FileAccessProvider
10 #include "base/safe_strerror_posix.h" 10 #include "base/safe_strerror_posix.h"
11 #include "base/scoped_vector.h"
11 #include "base/string_number_conversions.h" 12 #include "base/string_number_conversions.h"
12 #include "base/values.h" 13 #include "base/values.h"
13 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/browser_thread.h" // for FileAccessProvider 15 #include "chrome/browser/browser_thread.h" // for FileAccessProvider
15 #include "chrome/browser/certificate_manager_model.h" 16 #include "chrome/browser/certificate_manager_model.h"
16 #include "chrome/browser/certificate_viewer.h" 17 #include "chrome/browser/certificate_viewer.h"
17 #include "chrome/browser/gtk/certificate_dialogs.h" 18 #include "chrome/browser/gtk/certificate_dialogs.h"
18 #include "chrome/browser/tab_contents/tab_contents.h" 19 #include "chrome/browser/tab_contents/tab_contents.h"
19 #include "chrome/browser/tab_contents/tab_contents_view.h" 20 #include "chrome/browser/tab_contents/tab_contents_view.h"
20 #include "grit/generated_resources.h" 21 #include "grit/generated_resources.h"
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 852
852 ListValue args; 853 ListValue args;
853 args.Append(Value::CreateStringValue(tree_name)); 854 args.Append(Value::CreateStringValue(tree_name));
854 args.Append(nodes); 855 args.Append(nodes);
855 dom_ui_->CallJavascriptFunction(L"CertificateManager.onPopulateTree", args); 856 dom_ui_->CallJavascriptFunction(L"CertificateManager.onPopulateTree", args);
856 } 857 }
857 } 858 }
858 859
859 void CertificateManagerHandler::ShowError(const std::string& title, 860 void CertificateManagerHandler::ShowError(const std::string& title,
860 const std::string& error) const { 861 const std::string& error) const {
861 std::vector<const Value*> args; 862 ScopedVector<const Value> args;
862 args.push_back(Value::CreateStringValue(title)); 863 args.push_back(Value::CreateStringValue(title));
863 args.push_back(Value::CreateStringValue(error)); 864 args.push_back(Value::CreateStringValue(error));
864 args.push_back(Value::CreateNullValue()); // okTitle 865 args.push_back(Value::CreateStringValue(l10n_util::GetStringUTF8(IDS_OK)));
865 args.push_back(Value::CreateStringValue("")); // cancelTitle 866 args.push_back(Value::CreateNullValue()); // cancelTitle
866 args.push_back(Value::CreateNullValue()); // okCallback 867 args.push_back(Value::CreateNullValue()); // okCallback
867 args.push_back(Value::CreateNullValue()); // cancelCallback 868 args.push_back(Value::CreateNullValue()); // cancelCallback
868 dom_ui_->CallJavascriptFunction(L"AlertOverlay.show", args); 869 dom_ui_->CallJavascriptFunction(L"AlertOverlay.show", args.get());
869 } 870 }
870 871
871 void CertificateManagerHandler::ShowImportErrors( 872 void CertificateManagerHandler::ShowImportErrors(
872 const std::string& title, 873 const std::string& title,
873 const net::CertDatabase::ImportCertFailureList& not_imported) const { 874 const net::CertDatabase::ImportCertFailureList& not_imported) const {
874 std::string error; 875 std::string error;
875 if (selected_cert_list_.size() == 1) 876 if (selected_cert_list_.size() == 1)
876 error = l10n_util::GetStringUTF8( 877 error = l10n_util::GetStringUTF8(
877 IDS_CERT_MANAGER_IMPORT_SINGLE_NOT_IMPORTED); 878 IDS_CERT_MANAGER_IMPORT_SINGLE_NOT_IMPORTED);
878 else if (not_imported.size() == selected_cert_list_.size()) 879 else if (not_imported.size() == selected_cert_list_.size())
(...skipping 14 matching lines...) Expand all
893 StringValue error_value(error); 894 StringValue error_value(error);
894 dom_ui_->CallJavascriptFunction(L"CertificateImportErrorOverlay.show", 895 dom_ui_->CallJavascriptFunction(L"CertificateImportErrorOverlay.show",
895 title_value, 896 title_value,
896 error_value, 897 error_value,
897 cert_error_list); 898 cert_error_list);
898 } 899 }
899 900
900 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { 901 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const {
901 return dom_ui_->tab_contents()->view()->GetTopLevelNativeWindow(); 902 return dom_ui_->tab_contents()->view()->GetTopLevelNativeWindow();
902 } 903 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698