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/safe_strerror_posix.h" | 8 #include "base/safe_strerror_posix.h" |
9 #include "base/scoped_vector.h" | 9 #include "base/scoped_vector.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 void CertificateManagerHandler::CancelImportExportProcess( | 674 void CertificateManagerHandler::CancelImportExportProcess( |
675 const ListValue* args) { | 675 const ListValue* args) { |
676 ImportExportCleanup(); | 676 ImportExportCleanup(); |
677 } | 677 } |
678 | 678 |
679 void CertificateManagerHandler::ImportExportCleanup() { | 679 void CertificateManagerHandler::ImportExportCleanup() { |
680 file_path_.clear(); | 680 file_path_.clear(); |
681 password_.clear(); | 681 password_.clear(); |
682 file_data_.clear(); | 682 file_data_.clear(); |
683 selected_cert_list_.clear(); | 683 selected_cert_list_.clear(); |
| 684 module_ = NULL; |
| 685 |
| 686 // There may be pending file dialogs, we need to tell them that we've gone |
| 687 // away so they don't try and call back to us. |
| 688 if (select_file_dialog_.get()) |
| 689 select_file_dialog_->ListenerDestroyed(); |
684 select_file_dialog_ = NULL; | 690 select_file_dialog_ = NULL; |
685 module_ = NULL; | |
686 } | 691 } |
687 | 692 |
688 void CertificateManagerHandler::ImportServer(const ListValue* args) { | 693 void CertificateManagerHandler::ImportServer(const ListValue* args) { |
689 select_file_dialog_ = SelectFileDialog::Create(this); | 694 select_file_dialog_ = SelectFileDialog::Create(this); |
690 ShowCertSelectFileDialog( | 695 ShowCertSelectFileDialog( |
691 select_file_dialog_.get(), | 696 select_file_dialog_.get(), |
692 SelectFileDialog::SELECT_OPEN_FILE, | 697 SelectFileDialog::SELECT_OPEN_FILE, |
693 FilePath(), | 698 FilePath(), |
694 GetParentWindow(), | 699 GetParentWindow(), |
695 reinterpret_cast<void*>(IMPORT_SERVER_FILE_SELECTED)); | 700 reinterpret_cast<void*>(IMPORT_SERVER_FILE_SELECTED)); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 StringValue error_value(error); | 945 StringValue error_value(error); |
941 web_ui_->CallJavascriptFunction(L"CertificateImportErrorOverlay.show", | 946 web_ui_->CallJavascriptFunction(L"CertificateImportErrorOverlay.show", |
942 title_value, | 947 title_value, |
943 error_value, | 948 error_value, |
944 cert_error_list); | 949 cert_error_list); |
945 } | 950 } |
946 | 951 |
947 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 952 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
948 return web_ui_->tab_contents()->view()->GetTopLevelNativeWindow(); | 953 return web_ui_->tab_contents()->view()->GetTopLevelNativeWindow(); |
949 } | 954 } |
OLD | NEW |