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/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/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
11 #include "base/task.h" | 11 #include "base/task.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "crypto/crypto_module_blocking_password_delegate.h" | 13 #include "crypto/crypto_module_blocking_password_delegate.h" |
14 #include "chrome/browser/ui/gtk/gtk_util.h" | 14 #include "chrome/browser/ui/gtk/gtk_util.h" |
15 #include "content/browser/browser_thread.h" | 15 #include "content/browser/browser_thread.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 18 #include "ui/base/gtk/gtk_hig_constants.h" |
18 #include "ui/base/gtk/gtk_signal.h" | 19 #include "ui/base/gtk/gtk_signal.h" |
19 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 class CryptoModuleBlockingDialogDelegate | 24 class CryptoModuleBlockingDialogDelegate |
24 : public crypto::CryptoModuleBlockingPasswordDelegate { | 25 : public crypto::CryptoModuleBlockingPasswordDelegate { |
25 public: | 26 public: |
26 CryptoModuleBlockingDialogDelegate(browser::CryptoModulePasswordReason reason, | 27 CryptoModuleBlockingDialogDelegate(browser::CryptoModulePasswordReason reason, |
27 const std::string& server) | 28 const std::string& server) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 GtkWidget* label = gtk_label_new(text.c_str()); | 161 GtkWidget* label = gtk_label_new(text.c_str()); |
161 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | 162 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
162 gtk_util::LeftAlignMisc(label); | 163 gtk_util::LeftAlignMisc(label); |
163 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), label, | 164 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), label, |
164 FALSE, FALSE, 0); | 165 FALSE, FALSE, 0); |
165 | 166 |
166 password_entry_ = gtk_entry_new(); | 167 password_entry_ = gtk_entry_new(); |
167 gtk_entry_set_activates_default(GTK_ENTRY(password_entry_), TRUE); | 168 gtk_entry_set_activates_default(GTK_ENTRY(password_entry_), TRUE); |
168 gtk_entry_set_visibility(GTK_ENTRY(password_entry_), FALSE); | 169 gtk_entry_set_visibility(GTK_ENTRY(password_entry_), FALSE); |
169 | 170 |
170 GtkWidget* password_box = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); | 171 GtkWidget* password_box = gtk_hbox_new(FALSE, ui::kLabelSpacing); |
171 gtk_box_pack_start(GTK_BOX(password_box), | 172 gtk_box_pack_start(GTK_BOX(password_box), |
172 gtk_label_new(l10n_util::GetStringUTF8( | 173 gtk_label_new(l10n_util::GetStringUTF8( |
173 IDS_CRYPTO_MODULE_AUTH_DIALOG_PASSWORD_FIELD).c_str()), | 174 IDS_CRYPTO_MODULE_AUTH_DIALOG_PASSWORD_FIELD).c_str()), |
174 FALSE, FALSE, 0); | 175 FALSE, FALSE, 0); |
175 gtk_box_pack_start(GTK_BOX(password_box), password_entry_, | 176 gtk_box_pack_start(GTK_BOX(password_box), password_entry_, |
176 TRUE, TRUE, 0); | 177 TRUE, TRUE, 0); |
177 | 178 |
178 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), password_box, | 179 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), password_box, |
179 FALSE, FALSE, 0); | 180 FALSE, FALSE, 0); |
180 | 181 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 224 } |
224 | 225 |
225 crypto::CryptoModuleBlockingPasswordDelegate* | 226 crypto::CryptoModuleBlockingPasswordDelegate* |
226 NewCryptoModuleBlockingDialogDelegate( | 227 NewCryptoModuleBlockingDialogDelegate( |
227 CryptoModulePasswordReason reason, | 228 CryptoModulePasswordReason reason, |
228 const std::string& server) { | 229 const std::string& server) { |
229 return new CryptoModuleBlockingDialogDelegate(reason, server); | 230 return new CryptoModuleBlockingDialogDelegate(reason, server); |
230 } | 231 } |
231 | 232 |
232 } // namespace browser | 233 } // namespace browser |
OLD | NEW |