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/views/crypto_module_password_dialog_view.h" | 5 #include "chrome/browser/ui/views/crypto_module_password_dialog_view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
9 #include "components/strings/grit/components_strings.h" | 9 #include "components/strings/grit/components_strings.h" |
10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 void CryptoModulePasswordDialogView::Init(const std::string& hostname, | 81 void CryptoModulePasswordDialogView::Init(const std::string& hostname, |
82 const std::string& slot_name, | 82 const std::string& slot_name, |
83 CryptoModulePasswordReason reason) { | 83 CryptoModulePasswordReason reason) { |
84 // Select an appropriate text for the reason. | 84 // Select an appropriate text for the reason. |
85 std::string text; | 85 std::string text; |
86 const base::string16& hostname16 = base::UTF8ToUTF16(hostname); | 86 const base::string16& hostname16 = base::UTF8ToUTF16(hostname); |
87 const base::string16& slot16 = base::UTF8ToUTF16(slot_name); | 87 const base::string16& slot16 = base::UTF8ToUTF16(slot_name); |
88 switch (reason) { | 88 switch (reason) { |
89 case chrome::kCryptoModulePasswordKeygen: | |
90 text = l10n_util::GetStringFUTF8( | |
91 IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_KEYGEN, slot16, hostname16); | |
92 break; | |
93 case chrome::kCryptoModulePasswordCertEnrollment: | 89 case chrome::kCryptoModulePasswordCertEnrollment: |
94 text = l10n_util::GetStringFUTF8( | 90 text = l10n_util::GetStringFUTF8( |
95 IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_CERT_ENROLLMENT, | 91 IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_CERT_ENROLLMENT, |
96 slot16, | 92 slot16, |
97 hostname16); | 93 hostname16); |
98 break; | 94 break; |
99 case chrome::kCryptoModulePasswordClientAuth: | 95 case chrome::kCryptoModulePasswordClientAuth: |
100 text = l10n_util::GetStringFUTF8( | 96 text = l10n_util::GetStringFUTF8( |
101 IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_CLIENT_AUTH, slot16, hostname16); | 97 IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_CLIENT_AUTH, slot16, hostname16); |
102 break; | 98 break; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 CryptoModulePasswordReason reason, | 153 CryptoModulePasswordReason reason, |
158 const std::string& hostname, | 154 const std::string& hostname, |
159 gfx::NativeWindow parent, | 155 gfx::NativeWindow parent, |
160 const CryptoModulePasswordCallback& callback) { | 156 const CryptoModulePasswordCallback& callback) { |
161 CryptoModulePasswordDialogView* dialog = | 157 CryptoModulePasswordDialogView* dialog = |
162 new CryptoModulePasswordDialogView(slot_name, reason, hostname, callback); | 158 new CryptoModulePasswordDialogView(slot_name, reason, hostname, callback); |
163 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent)->Show(); | 159 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent)->Show(); |
164 } | 160 } |
165 | 161 |
166 } // namespace chrome | 162 } // namespace chrome |
OLD | NEW |