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

Side by Side Diff: chrome/browser/ui/gtk/password_generation_bubble_gtk.cc

Issue 11829012: Localize text in password generation bubble (http://www.chromium.org/developers/design-documents/pa… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 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/gtk/password_generation_bubble_gtk.h" 5 #include "chrome/browser/ui/gtk/password_generation_bubble_gtk.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/autofill/password_generator.h" 8 #include "chrome/browser/autofill/password_generator.h"
9 #include "chrome/browser/password_manager/password_manager.h" 9 #include "chrome/browser/password_manager/password_manager.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 autofill::PasswordGenerator* password_generator) 44 autofill::PasswordGenerator* password_generator)
45 : form_(form), 45 : form_(form),
46 web_contents_(web_contents), 46 web_contents_(web_contents),
47 password_generator_(password_generator) { 47 password_generator_(password_generator) {
48 // TODO(gcasto): Localize text after we have finalized the UI. 48 // TODO(gcasto): Localize text after we have finalized the UI.
49 // crbug.com/118062 49 // crbug.com/118062
50 GtkWidget* content = gtk_vbox_new(FALSE, 5); 50 GtkWidget* content = gtk_vbox_new(FALSE, 5);
51 51
52 // We have two lines of content. The first is the title and learn more link. 52 // We have two lines of content. The first is the title and learn more link.
53 GtkWidget* title_line = gtk_hbox_new(FALSE, 0); 53 GtkWidget* title_line = gtk_hbox_new(FALSE, 0);
54 GtkWidget* title = gtk_label_new("Password Suggestion"); 54 GtkWidget* title = gtk_label_new(
55 l10n_util::GetStringUTF8(IDS_PASSWORD_GENERATION_BUBBLE_TITLE).c_str());
55 gtk_box_pack_start(GTK_BOX(title_line), title, FALSE, FALSE, 0); 56 gtk_box_pack_start(GTK_BOX(title_line), title, FALSE, FALSE, 0);
56 GtkWidget* learn_more_link = gtk_chrome_link_button_new( 57 GtkWidget* learn_more_link = gtk_chrome_link_button_new(
57 l10n_util::GetStringUTF8(IDS_LEARN_MORE).c_str()); 58 l10n_util::GetStringUTF8(IDS_LEARN_MORE).c_str());
58 gtk_button_set_alignment(GTK_BUTTON(learn_more_link), 0.0, 0.5); 59 gtk_button_set_alignment(GTK_BUTTON(learn_more_link), 0.0, 0.5);
59 gtk_box_pack_start(GTK_BOX(title_line), 60 gtk_box_pack_start(GTK_BOX(title_line),
60 gtk_util::IndentWidget(learn_more_link), 61 gtk_util::IndentWidget(learn_more_link),
61 FALSE, FALSE, 0); 62 FALSE, FALSE, 0);
62 63
63 // The second contains the password in a text field, a regenerate button, and 64 // The second contains the password in a text field, a regenerate button, and
64 // an accept button. 65 // an accept button.
65 GtkWidget* password_line = gtk_hbox_new(FALSE, ui::kControlSpacing); 66 GtkWidget* password_line = gtk_hbox_new(FALSE, ui::kControlSpacing);
66 text_field_ = gtk_entry_new(); 67 text_field_ = gtk_entry_new();
67 gtk_entry_set_text(GTK_ENTRY(text_field_), 68 gtk_entry_set_text(GTK_ENTRY(text_field_),
68 password_generator_->Generate().c_str()); 69 password_generator_->Generate().c_str());
69 gtk_entry_set_max_length(GTK_ENTRY(text_field_), 15); 70 gtk_entry_set_max_length(GTK_ENTRY(text_field_), 15);
70 gtk_entry_set_icon_from_pixbuf( 71 gtk_entry_set_icon_from_pixbuf(
71 GTK_ENTRY(text_field_), GTK_ENTRY_ICON_SECONDARY, GetImage(IDR_RELOAD)); 72 GTK_ENTRY(text_field_), GTK_ENTRY_ICON_SECONDARY, GetImage(IDR_RELOAD));
72 gtk_entry_set_icon_tooltip_text( 73 gtk_entry_set_icon_tooltip_text(
73 GTK_ENTRY(text_field_), GTK_ENTRY_ICON_SECONDARY, "Regenerate"); 74 GTK_ENTRY(text_field_), GTK_ENTRY_ICON_SECONDARY, "Regenerate");
74 GtkWidget* accept_button = gtk_button_new_with_label("Try It"); 75 GtkWidget* accept_button = gtk_button_new_with_label(
76 l10n_util::GetStringUTF8(IDS_PASSWORD_GENERATION_BUTTON_TEXT).c_str());
75 gtk_box_pack_start(GTK_BOX(password_line), text_field_, TRUE, TRUE, 0); 77 gtk_box_pack_start(GTK_BOX(password_line), text_field_, TRUE, TRUE, 0);
76 gtk_box_pack_start(GTK_BOX(password_line), accept_button, TRUE, TRUE, 0); 78 gtk_box_pack_start(GTK_BOX(password_line), accept_button, TRUE, TRUE, 0);
77 79
78 gtk_container_set_border_width(GTK_CONTAINER(content), 80 gtk_container_set_border_width(GTK_CONTAINER(content),
79 ui::kContentAreaBorder); 81 ui::kContentAreaBorder);
80 gtk_box_pack_start(GTK_BOX(content), title_line, TRUE, TRUE, 0); 82 gtk_box_pack_start(GTK_BOX(content), title_line, TRUE, TRUE, 0);
81 gtk_box_pack_start(GTK_BOX(content), password_line, TRUE, TRUE, 0); 83 gtk_box_pack_start(GTK_BOX(content), password_line, TRUE, TRUE, 0);
82 84
83 // Set initial focus to the text field containing the generated password. 85 // Set initial focus to the text field containing the generated password.
84 gtk_widget_grab_focus(text_field_); 86 gtk_widget_grab_focus(text_field_);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 149
148 void PasswordGenerationBubbleGtk::OnLearnMoreLinkClicked(GtkButton* button) { 150 void PasswordGenerationBubbleGtk::OnLearnMoreLinkClicked(GtkButton* button) {
149 actions_.learn_more_visited = true; 151 actions_.learn_more_visited = true;
150 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); 152 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_);
151 content::OpenURLParams params( 153 content::OpenURLParams params(
152 GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(), 154 GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(),
153 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false); 155 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false);
154 browser->OpenURL(params); 156 browser->OpenURL(params);
155 bubble_->Close(); 157 bubble_->Close();
156 } 158 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698