| 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/certificate_dialogs.h" | 5 #include "chrome/browser/ui/certificate_dialogs.h" |
| 6 | 6 |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 file_type_info.extensions[2].push_back(FILE_PATH_LITERAL("der")); | 163 file_type_info.extensions[2].push_back(FILE_PATH_LITERAL("der")); |
| 164 file_type_info.extension_description_overrides.push_back( | 164 file_type_info.extension_description_overrides.push_back( |
| 165 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_DER)); | 165 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_DER)); |
| 166 file_type_info.extensions[3].push_back(FILE_PATH_LITERAL("p7c")); | 166 file_type_info.extensions[3].push_back(FILE_PATH_LITERAL("p7c")); |
| 167 file_type_info.extension_description_overrides.push_back( | 167 file_type_info.extension_description_overrides.push_back( |
| 168 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_PKCS7)); | 168 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_PKCS7)); |
| 169 file_type_info.extensions[4].push_back(FILE_PATH_LITERAL("p7c")); | 169 file_type_info.extensions[4].push_back(FILE_PATH_LITERAL("p7c")); |
| 170 file_type_info.extension_description_overrides.push_back( | 170 file_type_info.extension_description_overrides.push_back( |
| 171 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_PKCS7_CHAIN)); | 171 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_PKCS7_CHAIN)); |
| 172 file_type_info.include_all_files = true; | 172 file_type_info.include_all_files = true; |
| 173 // TODO(kinaba): http://crbug.com/140425. Turn file_type_info.support_drive | |
| 174 // on for saving once Google Drive client on ChromeOS supports it. | |
| 175 if (type == ui::SelectFileDialog::SELECT_OPEN_FILE) | |
| 176 file_type_info.support_drive = true; | |
| 177 select_file_dialog->SelectFile( | 173 select_file_dialog->SelectFile( |
| 178 type, string16(), | 174 type, string16(), |
| 179 suggested_path, &file_type_info, 1, | 175 suggested_path, &file_type_info, |
| 176 1, // 1-based index for |file_type_info.extensions| to specify default. |
| 180 FILE_PATH_LITERAL("crt"), | 177 FILE_PATH_LITERAL("crt"), |
| 181 parent, params); | 178 parent, params); |
| 182 } | 179 } |
| 183 | 180 |
| 184 void ShowCertExportDialog(WebContents* web_contents, | 181 void ShowCertExportDialog(WebContents* web_contents, |
| 185 gfx::NativeWindow parent, | 182 gfx::NativeWindow parent, |
| 186 net::X509Certificate::OSCertHandle cert) { | 183 net::X509Certificate::OSCertHandle cert) { |
| 187 new Exporter(web_contents, parent, cert); | 184 new Exporter(web_contents, parent, cert); |
| 188 } | 185 } |
| OLD | NEW |