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

Side by Side Diff: chrome/browser/ui/webui/options/certificate_manager_handler.cc

Issue 2600053002: net: change ImportFromPKCS12() to take a PK11SlotInfo* (Closed)
Patch Set: REBASE Created 3 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
OLDNEW
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/webui/options/certificate_manager_handler.h" 5 #include "chrome/browser/ui/webui/options/certificate_manager_handler.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 base::Unretained(this))); 850 base::Unretained(this)));
851 } 851 }
852 852
853 void CertificateManagerHandler::ImportPersonalSlotUnlocked() { 853 void CertificateManagerHandler::ImportPersonalSlotUnlocked() {
854 // Determine if the private key should be unextractable after the import. 854 // Determine if the private key should be unextractable after the import.
855 // We do this by checking the value of |use_hardware_backed_| which is set 855 // We do this by checking the value of |use_hardware_backed_| which is set
856 // to true if importing into a hardware module. Currently, this only happens 856 // to true if importing into a hardware module. Currently, this only happens
857 // for Chrome OS when the "Import and Bind" option is chosen. 857 // for Chrome OS when the "Import and Bind" option is chosen.
858 bool is_extractable = !use_hardware_backed_; 858 bool is_extractable = !use_hardware_backed_;
859 int result = certificate_manager_model_->ImportFromPKCS12( 859 int result = certificate_manager_model_->ImportFromPKCS12(
860 module_.get(), file_data_, password_, is_extractable); 860 module_->os_module_handle(), file_data_, password_, is_extractable);
861 ImportExportCleanup(); 861 ImportExportCleanup();
862 web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss"); 862 web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss");
863 int string_id; 863 int string_id;
864 switch (result) { 864 switch (result) {
865 case net::OK: 865 case net::OK:
866 return; 866 return;
867 case net::ERR_PKCS12_IMPORT_BAD_PASSWORD: 867 case net::ERR_PKCS12_IMPORT_BAD_PASSWORD:
868 // TODO(mattm): if the error was a bad password, we should reshow the 868 // TODO(mattm): if the error was a bad password, we should reshow the
869 // password dialog after the user dismisses the error dialog. 869 // password dialog after the user dismisses the error dialog.
870 string_id = IDS_CERT_MANAGER_BAD_PASSWORD; 870 string_id = IDS_CERT_MANAGER_BAD_PASSWORD;
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 web_ui()->CallJavascriptFunctionUnsafe("CertificateImportErrorOverlay.show", 1233 web_ui()->CallJavascriptFunctionUnsafe("CertificateImportErrorOverlay.show",
1234 title_value, error_value, 1234 title_value, error_value,
1235 cert_error_list); 1235 cert_error_list);
1236 } 1236 }
1237 1237
1238 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { 1238 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const {
1239 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); 1239 return web_ui()->GetWebContents()->GetTopLevelNativeWindow();
1240 } 1240 }
1241 1241
1242 } // namespace options 1242 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/ui/webui/settings/certificates_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698