| 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/crypto_module_password_dialog.h" | 5 #include "chrome/browser/ui/crypto_module_password_dialog.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 dialog_, | 63 dialog_, |
| 64 l10n_util::GetStringUTF8( | 64 l10n_util::GetStringUTF8( |
| 65 IDS_CRYPTO_MODULE_AUTH_DIALOG_OK_BUTTON_LABEL).c_str(), | 65 IDS_CRYPTO_MODULE_AUTH_DIALOG_OK_BUTTON_LABEL).c_str(), |
| 66 GTK_STOCK_OK, | 66 GTK_STOCK_OK, |
| 67 GTK_RESPONSE_ACCEPT); | 67 GTK_RESPONSE_ACCEPT); |
| 68 gtk_widget_set_can_default(ok_button, TRUE); | 68 gtk_widget_set_can_default(ok_button, TRUE); |
| 69 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); | 69 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); |
| 70 | 70 |
| 71 // Select an appropriate text for the reason. | 71 // Select an appropriate text for the reason. |
| 72 std::string text; | 72 std::string text; |
| 73 const base::string16& hostname16 = UTF8ToUTF16(hostname); | 73 const base::string16& hostname16 = base::UTF8ToUTF16(hostname); |
| 74 const base::string16& slot16 = UTF8ToUTF16(slot_name); | 74 const base::string16& slot16 = base::UTF8ToUTF16(slot_name); |
| 75 switch (reason) { | 75 switch (reason) { |
| 76 case chrome::kCryptoModulePasswordKeygen: | 76 case chrome::kCryptoModulePasswordKeygen: |
| 77 text = l10n_util::GetStringFUTF8( | 77 text = l10n_util::GetStringFUTF8( |
| 78 IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_KEYGEN, slot16, hostname16); | 78 IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_KEYGEN, slot16, hostname16); |
| 79 break; | 79 break; |
| 80 case chrome::kCryptoModulePasswordCertEnrollment: | 80 case chrome::kCryptoModulePasswordCertEnrollment: |
| 81 text = l10n_util::GetStringFUTF8( | 81 text = l10n_util::GetStringFUTF8( |
| 82 IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_CERT_ENROLLMENT, | 82 IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_CERT_ENROLLMENT, |
| 83 slot16, | 83 slot16, |
| 84 hostname16); | 84 hostname16); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 bool retry, | 160 bool retry, |
| 161 CryptoModulePasswordReason reason, | 161 CryptoModulePasswordReason reason, |
| 162 const std::string& hostname, | 162 const std::string& hostname, |
| 163 gfx::NativeWindow parent, | 163 gfx::NativeWindow parent, |
| 164 const CryptoModulePasswordCallback& callback) { | 164 const CryptoModulePasswordCallback& callback) { |
| 165 (new CryptoModulePasswordDialog( | 165 (new CryptoModulePasswordDialog( |
| 166 slot_name, retry, reason, hostname, parent, callback))->Show(); | 166 slot_name, retry, reason, hostname, parent, callback))->Show(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 } // namespace chrome | 169 } // namespace chrome |
| OLD | NEW |