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/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" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "chrome/browser/chrome_select_file_policy.h" |
15 #include "chrome/common/net/x509_certificate_model.h" | 16 #include "chrome/common/net/x509_certificate_model.h" |
16 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
19 | 20 |
20 using content::BrowserThread; | 21 using content::BrowserThread; |
21 using content::WebContents; | 22 using content::WebContents; |
22 | 23 |
23 namespace { | 24 namespace { |
24 | 25 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 file_type_info.extensions[3].push_back(FILE_PATH_LITERAL("p7c")); | 164 file_type_info.extensions[3].push_back(FILE_PATH_LITERAL("p7c")); |
164 file_type_info.extension_description_overrides.push_back( | 165 file_type_info.extension_description_overrides.push_back( |
165 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_PKCS7)); | 166 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_PKCS7)); |
166 file_type_info.extensions[4].push_back(FILE_PATH_LITERAL("p7c")); | 167 file_type_info.extensions[4].push_back(FILE_PATH_LITERAL("p7c")); |
167 file_type_info.extension_description_overrides.push_back( | 168 file_type_info.extension_description_overrides.push_back( |
168 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_PKCS7_CHAIN)); | 169 l10n_util::GetStringUTF16(IDS_CERT_EXPORT_TYPE_PKCS7_CHAIN)); |
169 file_type_info.include_all_files = true; | 170 file_type_info.include_all_files = true; |
170 select_file_dialog->SelectFile( | 171 select_file_dialog->SelectFile( |
171 type, string16(), | 172 type, string16(), |
172 suggested_path, &file_type_info, 1, | 173 suggested_path, &file_type_info, 1, |
173 FILE_PATH_LITERAL("crt"), web_contents, | 174 FILE_PATH_LITERAL("crt"), |
| 175 ChromeSelectFilePolicy::DisplayInfobarCallback(web_contents), |
174 parent, params); | 176 parent, params); |
175 } | 177 } |
176 | 178 |
177 void ShowCertExportDialog(WebContents* web_contents, | 179 void ShowCertExportDialog(WebContents* web_contents, |
178 gfx::NativeWindow parent, | 180 gfx::NativeWindow parent, |
179 net::X509Certificate::OSCertHandle cert) { | 181 net::X509Certificate::OSCertHandle cert) { |
180 new Exporter(web_contents, parent, cert); | 182 new Exporter(web_contents, parent, cert); |
181 } | 183 } |
OLD | NEW |