summaryrefslogtreecommitdiffstats
path: root/views/controls/textfield
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 01:08:44 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 01:08:44 +0000
commitc9408bca7cc3e45ab12bff6b3c4d554e4414c903 (patch)
tree26aa96dbbcc7fa1b91ed46716311b2dd7bcd8e22 /views/controls/textfield
parent7e9e8584da57a63465cd9619fb023a427e8d6bfe (diff)
downloadchromium_src-c9408bca7cc3e45ab12bff6b3c4d554e4414c903.zip
chromium_src-c9408bca7cc3e45ab12bff6b3c4d554e4414c903.tar.gz
chromium_src-c9408bca7cc3e45ab12bff6b3c4d554e4414c903.tar.bz2
* Password style support for gtk's textfield impl.
* Added x11 dependency to view_examples. Looks like dependency has changed a bit. BUG=none TEST=build & run view_examples target. Review URL: http://codereview.chromium.org/270032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/textfield')
-rw-r--r--views/controls/textfield/native_textfield_gtk.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/views/controls/textfield/native_textfield_gtk.cc b/views/controls/textfield/native_textfield_gtk.cc
index ebaa614..9704e7e 100644
--- a/views/controls/textfield/native_textfield_gtk.cc
+++ b/views/controls/textfield/native_textfield_gtk.cc
@@ -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 @@ gboolean NativeTextfieldGtk::OnChanged() {
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) {