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

Unified Diff: views/controls/textfield/native_textfield_gtk.cc

Issue 270032: Password style support for gtk's textfield impl.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | views/examples/examples_main_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/native_textfield_gtk.cc
===================================================================
--- views/controls/textfield/native_textfield_gtk.cc (revision 28398)
+++ views/controls/textfield/native_textfield_gtk.cc (working copy)
@@ -12,6 +12,8 @@
#include "views/controls/textfield/textfield.h"
namespace views {
+// A character used to hide a text in password mode.
+const char kPasswordChar = '*';
////////////////////////////////////////////////////////////////////////////////
// NativeTextfieldGtk, public:
@@ -229,6 +231,11 @@
void NativeTextfieldGtk::CreateNativeControl() {
NativeControlCreated(gtk_entry_new());
+ if (textfield_->IsPassword()) {
+ gtk_entry_set_invisible_char(GTK_ENTRY(native_view()),
+ static_cast<gunichar>(kPasswordChar));
+ gtk_entry_set_visibility(GTK_ENTRY(native_view()), false);
+ }
}
void NativeTextfieldGtk::NativeControlCreated(GtkWidget* widget) {
« no previous file with comments | « no previous file | views/examples/examples_main_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698