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

Side by Side Diff: chrome/browser/login_prompt_gtk.cc

Issue 140076: GTK: Polish HTTP Auth UI. Adds standard border and word wraps the label. (Closed)
Patch Set: Fixes for evan Created 11 years, 6 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
« no previous file with comments | « chrome/browser/gtk/constrained_window_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/login_prompt.h" 5 #include "chrome/browser/login_prompt.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 virtual ~LoginHandlerGtk() { 50 virtual ~LoginHandlerGtk() {
51 root_.Destroy(); 51 root_.Destroy();
52 } 52 }
53 53
54 // LoginHandler: 54 // LoginHandler:
55 virtual void BuildViewForPasswordManager(PasswordManager* manager, 55 virtual void BuildViewForPasswordManager(PasswordManager* manager,
56 std::wstring explanation) { 56 std::wstring explanation) {
57 DCHECK(MessageLoop::current() == ui_loop_); 57 DCHECK(MessageLoop::current() == ui_loop_);
58 58
59 root_.Own(gtk_vbox_new(NULL, gtk_util::kContentAreaBorder)); 59 root_.Own(gtk_vbox_new(NULL, gtk_util::kContentAreaBorder));
60 gtk_box_pack_start(GTK_BOX(root_.get()), 60 GtkWidget* label = gtk_label_new(WideToUTF8(explanation).c_str());
61 gtk_label_new(WideToUTF8(explanation).c_str()), 61 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
62 FALSE, FALSE, 0); 62 gtk_box_pack_start(GTK_BOX(root_.get()), label, FALSE, FALSE, 0);
63 63
64 username_entry_ = gtk_entry_new(); 64 username_entry_ = gtk_entry_new();
65 gtk_entry_set_activates_default(GTK_ENTRY(username_entry_), TRUE); 65 gtk_entry_set_activates_default(GTK_ENTRY(username_entry_), TRUE);
66 66
67 password_entry_ = gtk_entry_new(); 67 password_entry_ = gtk_entry_new();
68 gtk_entry_set_activates_default(GTK_ENTRY(password_entry_), TRUE); 68 gtk_entry_set_activates_default(GTK_ENTRY(password_entry_), TRUE);
69 gtk_entry_set_visibility(GTK_ENTRY(password_entry_), FALSE); 69 gtk_entry_set_visibility(GTK_ENTRY(password_entry_), FALSE);
70 70
71 GtkWidget* table = gtk_util::CreateLabeledControlsGroup( 71 GtkWidget* table = gtk_util::CreateLabeledControlsGroup(
72 l10n_util::GetStringUTF8(IDS_LOGIN_DIALOG_USERNAME_FIELD).c_str(), 72 l10n_util::GetStringUTF8(IDS_LOGIN_DIALOG_USERNAME_FIELD).c_str(),
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 GtkWidget* username_entry_; 303 GtkWidget* username_entry_;
304 GtkWidget* password_entry_; 304 GtkWidget* password_entry_;
305 305
306 DISALLOW_COPY_AND_ASSIGN(LoginHandlerGtk); 306 DISALLOW_COPY_AND_ASSIGN(LoginHandlerGtk);
307 }; 307 };
308 308
309 // static 309 // static
310 LoginHandler* LoginHandler::Create(URLRequest* request, MessageLoop* ui_loop) { 310 LoginHandler* LoginHandler::Create(URLRequest* request, MessageLoop* ui_loop) {
311 return new LoginHandlerGtk(request, ui_loop); 311 return new LoginHandlerGtk(request, ui_loop);
312 } 312 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/constrained_window_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698