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

Issue 8747001: Reintroduce password support to NativeTextfieldViews (Closed)

Created:
9 years ago by benrg
Modified:
8 years, 9 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, tfarina, penghuang+watch_chromium.org, Paweł Hajdan Jr., James Su, dhollowa, jungshik at Google
Visibility:
Public.

Description

Support for password entry fields, with all characters displayed as '*', was implemented in NativeTextfieldViews via TextfieldViewsModel::GetVisibleText() (issue 5857002), but the refactoring into RenderText (issue 7265011) removed all calls of that method. I moved the password handling code into RenderText because I think it's logically a visual style (although RenderText also contains a lot of model-related stuff right now). RenderText now has a password property (in earlier patchsets it was an attribute in StyleRange). BUG=105054 TEST=unit tests and manual testing of the wifi login dialog Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=124611

Patch Set 1 : rerebase #

Total comments: 2

Patch Set 2 : fix EXPECT_EQ order #

Patch Set 3 : make ApplyStyleRange fail if default_style_.password #

Patch Set 4 : make password in RenderText an instance property and disable cut, copy, D&D, and word skipping #

Total comments: 23

Patch Set 5 : rebase, const syntax, password->obscured, dead methods, DCHECK, Ctrl+[CX] tests, fix other tests #

Total comments: 10

Patch Set 6 : delete more dead code, address recent comments #

Total comments: 2

Patch Set 7 : rebase #

Patch Set 8 : new implementation, linux only #

Total comments: 49

Patch Set 9 : comments, Utf16OffsetToPointer bug #

Total comments: 16

Patch Set 10 : rebase to r123531, no other changes (not for review) #

Patch Set 11 : minor unit test change #

Patch Set 12 : tweak NativeTextfieldViews::ExecuteCommand #

Total comments: 15

Patch Set 13 : more documentation in Utf16OffsetToIndex #

Patch Set 14 : documentation changes and minor fixes #

Patch Set 15 : move helpers from base/ to ui/base/ #

Patch Set 16 : rebase #

Patch Set 17 : fix windows test #

Patch Set 18 : for dcommit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+397 lines, -93 lines) Patch
A ui/base/text/utf16_indexing.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +50 lines, -0 lines 0 comments Download
A ui/base/text/utf16_indexing.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +55 lines, -0 lines 0 comments Download
A ui/base/text/utf16_indexing_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +32 lines, -0 lines 0 comments Download
M ui/gfx/render_text.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +12 lines, -0 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +28 lines, -1 line 0 comments Download
M ui/gfx/render_text_linux.h View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -7 lines 0 comments Download
M ui/gfx/render_text_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 15 chunks +50 lines, -55 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +75 lines, -0 lines 0 comments Download
M ui/ui.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M ui/ui_unittests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_views.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +14 lines, -13 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_views_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +20 lines, -0 lines 0 comments Download
M ui/views/controls/textfield/textfield_views_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +9 lines, -5 lines 0 comments Download
M ui/views/controls/textfield/textfield_views_model_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +41 lines, -12 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
benrg
Oshima, could you look at this? msw would be another possibility.
9 years ago (2011-11-30 21:12:41 UTC) #1
oshima
I think msw should review this too, and please implement this for windows as well. ...
9 years ago (2011-12-01 21:36:46 UTC) #2
benrg
I'll work on a Windows implementation. I don't have a working Windows Aura build yet, ...
9 years ago (2011-12-01 22:36:15 UTC) #3
oshima
On 2011/12/01 22:36:15, benrg wrote: > I'll work on a Windows implementation. I don't have ...
9 years ago (2011-12-01 23:11:46 UTC) #4
benrg
> I consider that if default one has password, intention is clear that you want ...
9 years ago (2011-12-02 00:07:17 UTC) #5
msw
We'll never need a portion of the text to be a password while the rest ...
9 years ago (2011-12-02 00:42:03 UTC) #6
msw
+xji for RenderText[Linux].
9 years ago (2011-12-02 00:42:24 UTC) #7
benrg
The password flag is now an instance variable. In terms of code side it's pretty ...
9 years ago (2011-12-02 21:48:32 UTC) #8
oshima
http://codereview.chromium.org/8747001/diff/15001/ui/gfx/render_text.h File ui/gfx/render_text.h (right): http://codereview.chromium.org/8747001/diff/15001/ui/gfx/render_text.h#newcode86 ui/gfx/render_text.h:86: void SetIsPassword(bool password); I thought we wanted to change ...
9 years ago (2011-12-02 23:15:54 UTC) #9
msw
Looking better, thanks for iterating! http://codereview.chromium.org/8747001/diff/15001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): http://codereview.chromium.org/8747001/diff/15001/ui/gfx/render_text.cc#newcode21 ui/gfx/render_text.cc:21: const char16 PASSWORD_REPLACEMENT_CHAR = ...
9 years ago (2011-12-03 00:22:40 UTC) #10
xji
http://codereview.chromium.org/8747001/diff/15001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): http://codereview.chromium.org/8747001/diff/15001/ui/gfx/render_text.cc#newcode379 ui/gfx/render_text.cc:379: return default_style_.font.GetStringWidth(text()); On 2011/12/03 00:22:40, msw wrote: > Shouldn't ...
9 years ago (2011-12-06 01:24:04 UTC) #11
benrg
Thanks for all the feedback. I'm uploading a new draft and publishing comments since it's ...
9 years ago (2011-12-06 17:21:29 UTC) #12
oshima
http://codereview.chromium.org/8747001/diff/22001/ui/gfx/render_text.h File ui/gfx/render_text.h (right): http://codereview.chromium.org/8747001/diff/22001/ui/gfx/render_text.h#newcode86 ui/gfx/render_text.h:86: void SetIsObscured(bool obscured); SetObscured http://codereview.chromium.org/8747001/diff/22001/ui/gfx/render_text.h#newcode297 ui/gfx/render_text.h:297: // True if ...
9 years ago (2011-12-06 23:57:17 UTC) #13
benrg
The more I think about Utf16IndexToUtf8Index and friends, the more horrifying it becomes. This function ...
9 years ago (2011-12-08 21:40:54 UTC) #14
xji
http://codereview.chromium.org/8747001/diff/35001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): http://codereview.chromium.org/8747001/diff/35001/ui/gfx/render_text.cc#newcode151 ui/gfx/render_text.cc:151: // use non-BMP code points and combining diacritics in ...
9 years ago (2011-12-22 01:11:20 UTC) #15
benrg
http://codereview.chromium.org/8747001/diff/35001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): http://codereview.chromium.org/8747001/diff/35001/ui/gfx/render_text.cc#newcode151 ui/gfx/render_text.cc:151: // use non-BMP code points and combining diacritics in ...
9 years ago (2011-12-22 02:14:21 UTC) #16
benrg
PTAL. This is a new implementation of STYLE_OBSCURED for Linux only. I wanted to merge ...
8 years, 10 months ago (2012-02-17 03:27:34 UTC) #17
xji
Great job! http://codereview.chromium.org/8747001/diff/55003/base/utf_offset_string_conversions.h File base/utf_offset_string_conversions.h (right): http://codereview.chromium.org/8747001/diff/55003/base/utf_offset_string_conversions.h#newcode18 base/utf_offset_string_conversions.h:18: BASE_EXPORT bool IsValidUtf16Index(const string16& s, size_t index); ...
8 years, 10 months ago (2012-02-18 01:28:46 UTC) #18
msw
+Alexei. Would it be simpler to implement this in NativeTextfieldViews or TextfieldViewsModel and just pass ...
8 years, 10 months ago (2012-02-22 00:33:25 UTC) #19
Alexei Svitkine (slow)
On 2012/02/22 00:33:25, msw wrote: > +Alexei. Would it be simpler to implement this in ...
8 years, 10 months ago (2012-02-22 01:12:54 UTC) #20
benrg
No code changes yet, just responding to design comments. > Does this work in some ...
8 years, 10 months ago (2012-02-22 02:25:42 UTC) #21
benrg
I backed out all of my optimizations, so it may be easier to compare against ...
8 years, 10 months ago (2012-02-24 19:07:44 UTC) #22
benrg
I uploaded a TextfieldViewsModel implementation as a separate CL: http://codereview.chromium.org/9467017/
8 years, 10 months ago (2012-02-24 21:56:43 UTC) #23
xji
http://codereview.chromium.org/8747001/diff/75003/base/utf_offset_string_conversions.h File base/utf_offset_string_conversions.h (right): http://codereview.chromium.org/8747001/diff/75003/base/utf_offset_string_conversions.h#newcode39 base/utf_offset_string_conversions.h:39: BASE_EXPORT ptrdiff_t Utf16IndexToOffset(const string16& s, since those functions only ...
8 years, 10 months ago (2012-02-25 00:06:14 UTC) #24
benrg
http://codereview.chromium.org/8747001/diff/75003/base/utf_offset_string_conversions.h File base/utf_offset_string_conversions.h (right): http://codereview.chromium.org/8747001/diff/75003/base/utf_offset_string_conversions.h#newcode39 base/utf_offset_string_conversions.h:39: BASE_EXPORT ptrdiff_t Utf16IndexToOffset(const string16& s, On 2012/02/25 00:06:14, xji ...
8 years, 9 months ago (2012-03-01 17:18:00 UTC) #25
xji
http://codereview.chromium.org/8747001/diff/75003/base/utf_offset_string_conversions.cc File base/utf_offset_string_conversions.cc (right): http://codereview.chromium.org/8747001/diff/75003/base/utf_offset_string_conversions.cc#newcode93 base/utf_offset_string_conversions.cc:93: if (!IsValidCodePointIndex(s, pos)) this line only reachable when |offset| ...
8 years, 9 months ago (2012-03-01 19:33:49 UTC) #26
xji
lgtm with comments addressed. pls. ask msw for review too.
8 years, 9 months ago (2012-03-01 19:39:50 UTC) #27
benrg
http://codereview.chromium.org/8747001/diff/75003/base/utf_offset_string_conversions.cc File base/utf_offset_string_conversions.cc (right): http://codereview.chromium.org/8747001/diff/75003/base/utf_offset_string_conversions.cc#newcode93 base/utf_offset_string_conversions.cc:93: if (!IsValidCodePointIndex(s, pos)) On 2012/03/01 19:33:49, xji wrote: > ...
8 years, 9 months ago (2012-03-01 21:07:52 UTC) #28
msw
I don't understand the RenderTextLinux text<->layout index conversion subtleties sufficiently to offer meaningful feedback there, ...
8 years, 9 months ago (2012-03-01 22:48:54 UTC) #29
Ben Goodger (Google)
LGTM for the views stuff. xji is sufficient for the render text.
8 years, 9 months ago (2012-03-01 23:29:31 UTC) #30
benrg
http://codereview.chromium.org/8747001/diff/82005/base/utf_offset_string_conversions.cc File base/utf_offset_string_conversions.cc (right): http://codereview.chromium.org/8747001/diff/82005/base/utf_offset_string_conversions.cc#newcode81 base/utf_offset_string_conversions.cc:81: size_t Utf16OffsetToIndex(const string16& s, size_t pos, ptrdiff_t offset) { ...
8 years, 9 months ago (2012-03-02 00:06:07 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benrg@chromium.org/8747001/86001
8 years, 9 months ago (2012-03-02 02:29:06 UTC) #32
commit-bot: I haz the power
8 years, 9 months ago (2012-03-02 04:10:43 UTC) #33

Powered by Google App Engine
This is Rietveld 408576698