| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CERTIFICATES_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CERTIFICATES_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CERTIFICATES_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CERTIFICATES_HANDLER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/task/cancelable_task_tracker.h" | 14 #include "base/task/cancelable_task_tracker.h" |
| 15 #include "chrome/browser/certificate_manager_model.h" | 15 #include "chrome/browser/certificate_manager_model.h" |
| 16 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" | 16 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
| 17 #include "net/cert/nss_cert_database.h" | 17 #include "net/cert/nss_cert_database.h" |
| 18 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
| 19 #include "ui/shell_dialogs/select_file_dialog.h" | 19 #include "ui/shell_dialogs/select_file_dialog.h" |
| 20 | 20 |
| 21 namespace settings { | 21 namespace settings { |
| 22 | 22 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 void HandleImportCATrustSelected(const base::ListValue* args); | 123 void HandleImportCATrustSelected(const base::ListValue* args); |
| 124 | 124 |
| 125 // Export a certificate. | 125 // Export a certificate. |
| 126 void HandleExportCertificate(const base::ListValue* args); | 126 void HandleExportCertificate(const base::ListValue* args); |
| 127 | 127 |
| 128 // Delete certificate and private key (if any). | 128 // Delete certificate and private key (if any). |
| 129 void HandleDeleteCertificate(const base::ListValue* args); | 129 void HandleDeleteCertificate(const base::ListValue* args); |
| 130 | 130 |
| 131 // Model initialization methods. | 131 // Model initialization methods. |
| 132 void OnCertificateManagerModelCreated( | 132 void OnCertificateManagerModelCreated( |
| 133 scoped_ptr<CertificateManagerModel> model); | 133 std::unique_ptr<CertificateManagerModel> model); |
| 134 void CertificateManagerModelReady(); | 134 void CertificateManagerModelReady(); |
| 135 | 135 |
| 136 // Populate the trees in all the tabs. | 136 // Populate the trees in all the tabs. |
| 137 void HandleRefreshCertificates(const base::ListValue* args); | 137 void HandleRefreshCertificates(const base::ListValue* args); |
| 138 | 138 |
| 139 // Populate the given tab's tree. | 139 // Populate the given tab's tree. |
| 140 void PopulateTree(const std::string& tab_name, | 140 void PopulateTree(const std::string& tab_name, |
| 141 net::CertType type, | 141 net::CertType type, |
| 142 const net::CertificateList& web_trust_certs); | 142 const net::CertificateList& web_trust_certs); |
| 143 | 143 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 162 // has been fulfilled. | 162 // has been fulfilled. |
| 163 void AssignWebUICallbackId(const base::ListValue* args); | 163 void AssignWebUICallbackId(const base::ListValue* args); |
| 164 | 164 |
| 165 gfx::NativeWindow GetParentWindow() const; | 165 gfx::NativeWindow GetParentWindow() const; |
| 166 | 166 |
| 167 // True if certificate viewer should be shown in modal instead of constrianed | 167 // True if certificate viewer should be shown in modal instead of constrianed |
| 168 // dialog. | 168 // dialog. |
| 169 bool show_certs_in_modal_dialog_; | 169 bool show_certs_in_modal_dialog_; |
| 170 // The Certificates Manager model | 170 // The Certificates Manager model |
| 171 bool requested_certificate_manager_model_; | 171 bool requested_certificate_manager_model_; |
| 172 scoped_ptr<CertificateManagerModel> certificate_manager_model_; | 172 std::unique_ptr<CertificateManagerModel> certificate_manager_model_; |
| 173 | 173 |
| 174 // For multi-step import or export processes, we need to store the path, | 174 // For multi-step import or export processes, we need to store the path, |
| 175 // password, etc the user chose while we wait for them to enter a password, | 175 // password, etc the user chose while we wait for them to enter a password, |
| 176 // wait for file to be read, etc. | 176 // wait for file to be read, etc. |
| 177 base::FilePath file_path_; | 177 base::FilePath file_path_; |
| 178 base::string16 password_; | 178 base::string16 password_; |
| 179 // The WebUI callback ID of the last in-flight async request. There is always | 179 // The WebUI callback ID of the last in-flight async request. There is always |
| 180 // only one in-flight such request. | 180 // only one in-flight such request. |
| 181 std::string webui_callback_id_; | 181 std::string webui_callback_id_; |
| 182 bool use_hardware_backed_; | 182 bool use_hardware_backed_; |
| 183 std::string file_data_; | 183 std::string file_data_; |
| 184 net::CertificateList selected_cert_list_; | 184 net::CertificateList selected_cert_list_; |
| 185 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; | 185 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
| 186 scoped_refptr<net::CryptoModule> module_; | 186 scoped_refptr<net::CryptoModule> module_; |
| 187 | 187 |
| 188 // Used in reading and writing certificate files. | 188 // Used in reading and writing certificate files. |
| 189 base::CancelableTaskTracker tracker_; | 189 base::CancelableTaskTracker tracker_; |
| 190 scoped_refptr<FileAccessProvider> file_access_provider_; | 190 scoped_refptr<FileAccessProvider> file_access_provider_; |
| 191 | 191 |
| 192 scoped_ptr<CertIdMap> cert_id_map_; | 192 std::unique_ptr<CertIdMap> cert_id_map_; |
| 193 | 193 |
| 194 base::WeakPtrFactory<CertificatesHandler> weak_ptr_factory_; | 194 base::WeakPtrFactory<CertificatesHandler> weak_ptr_factory_; |
| 195 | 195 |
| 196 DISALLOW_COPY_AND_ASSIGN(CertificatesHandler); | 196 DISALLOW_COPY_AND_ASSIGN(CertificatesHandler); |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 } // namespace settings | 199 } // namespace settings |
| 200 | 200 |
| 201 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CERTIFICATES_HANDLER_H_ | 201 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CERTIFICATES_HANDLER_H_ |
| OLD | NEW |