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

Unified Diff: ui/gfx/render_text.h

Issue 8747001: Reintroduce password support to NativeTextfieldViews (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make password in RenderText an instance property and disable cut, copy, D&D, and word skipping Created 9 years 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 | ui/gfx/render_text.cc » ('j') | ui/gfx/render_text.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index da3607d9e11f8ed7109d2033f28903f7171b9d19..ca33c7847ec23bd342cc74d8143668e546e66d52 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -21,16 +21,6 @@
namespace gfx {
-// Color settings for text, backgrounds and cursor.
-// These are tentative, and should be derived from theme, system
-// settings and current settings.
-// TODO(oshima): Change this to match the standard chrome
-// before dogfooding textfield views.
-const SkColor kSelectedTextColor = SK_ColorWHITE;
-const SkColor kFocusedSelectionColor = SkColorSetRGB(30, 144, 255);
-const SkColor kUnfocusedSelectionColor = SK_ColorLTGRAY;
-const SkColor kCursorColor = SK_ColorBLACK;
-
class Canvas;
class RenderTextTest;
@@ -73,6 +63,10 @@ class UI_EXPORT RenderText {
const string16& text() const { return text_; }
void SetText(const string16& text);
+ // Like text() except that it returns asterisks or bullets if this is a
+ // password field.
+ string16 GetCensoredText() const;
+
const SelectionModel& selection_model() const { return selection_model_; }
bool cursor_visible() const { return cursor_visible_; }
@@ -87,6 +81,10 @@ class UI_EXPORT RenderText {
const StyleRange& default_style() const { return default_style_; }
void set_default_style(StyleRange style) { default_style_ = style; }
+ // In a password field, all text is drawn as asterisks or bullets.
+ bool is_password() const { return password_; }
+ void SetIsPassword(bool password);
oshima 2011/12/02 23:15:54 I thought we wanted to change "password" to someth
benrg 2011/12/06 17:21:30 Done. I originally split off issue 8748001 because
+
const Rect& display_rect() const { return display_rect_; }
void SetDisplayRect(const Rect& r);
@@ -296,6 +294,9 @@ class UI_EXPORT RenderText {
// The default text style.
StyleRange default_style_;
+ // True if this is a password field.
+ bool password_;
+
// The local display area for rendering the text.
Rect display_rect_;
// The offset for the text to be drawn, relative to the display area.
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | ui/gfx/render_text.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698