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

Issue 10693160: Add and specify Views::Textfield::SelectAll |reversed| flag, etc. (Closed)

Created:
8 years, 5 months ago by msw
Modified:
8 years, 5 months ago
CC:
chromium-reviews, tfarina, James Su, penghuang+watch_chromium.org, yusukes+watch_chromium.org, xji, Alexei Svitkine (slow)
Visibility:
Public.

Description

Add and specify Views::Textfield::SelectAll |reversed| flag, etc. SelectAll should be consistent and explicit with range reversal. This dictates if leading or trailing text is shown when textfields overflow. Currently, NativeTextfield[Win|Views]::SelectAll behavior is implicit and differs. (Windows native reverses the selection, while ChromeOS/Views doesn't) Revise SelectAll in RenderText, NativeTextfieldWin, and OmniboxViewViews. Add the |reversed| parameter and plumbing to related interfaces/functions. Add/update RenderTextTest.SelectAll and TextfieldViewsModelTest.Selection. Specify explicit reversal behavior in all the following cases: 1) Use reversed selection (changes ChromeOS/Views behavior) in: a) BookmarkBubbleView::ShowBubble (focus on bookmark title when shown). b) BookmarkEditorView::Accept (focus on invalid bookmark URL on "Save"). c) BookmarkEditorView::Show (focus on bookmark title when shown). d) FindBarView::UpdateForResult (find bar matches are found/iterated). e) FindBarView::SetFocusAndSelection (find bar shown, etc.). f) FindBarView::SearchTextfieldView::RequestFocus (click find bar parts, etc.). g) EditSearchEngineDialog::Show (focus on search engine title when shown). h) LoginView::OnAutofillDataAvailable (HTTP/FTP auth window shown). i) MessageBoxView::ViewHierarchyChanged (JS dialog with text input shown). 2) Use forward selection (changes Windows native behavior) in: a) NativeTextfieldWin::ExecuteCommand (textfield context menu "Select All"). (note: the Omnibox context menu "Select All" already uses forward selection) b) Textfield::AboutToRequestFocusFromTabTraversal (focus via tab-traversal). (note1: THIS IS CONTENTIOUS! Though OmniBoxViewWin is unaffected) (note2: OmniboxViewViews should be fixed later as per crbug.com/134701#c9) c) TreeView::StartEditing (editing tree view nodes ex/ collected cookies). d) NativeTextfieldViewsTest.* and ViewTest.* (changes inconsequential to tests) 3) Formally specify existing implicit behavior (no behavioral change): a) NativeTextfieldWin::OnAfterPossibleChange (temporary selection is reversed). b) NativeTextfieldViews::OnGestureEvent (double tap is forwards). c) NativeTextfieldViews::ExecuteCommand (context menu "Select All" is forwards). d) NativeTextfieldViews::HandleKeyEvent (CTRL-A is forwards). e) NativeTextfieldViews::HandleMousePressEvent (triple-click is forwards). f) TextfieldViewsModel::SetText (temporary selection is forwards). g) TextfieldViewsModelTest.* is mostly forwards, |Selection| tests reversed. TBR=ben@chromium.org BUG=134762 TEST=New RenderTextTest.SelectAll, updated TextfieldViewsModelTest.Selection, other unit tests, manual. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=146520

Patch Set 1 : Add |reversed| parameter to Textfield::SelectAll, etc. #

Patch Set 2 : Adjust specific instances for forward/reverse selection; remove TODOs, etc. #

Patch Set 3 : Flip EditSearchEngineDialog, LoginView, and MessageBoxView cases. #

Patch Set 4 : Remove redundant comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -85 lines) Patch
M chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/edit_search_engine_dialog.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/find_bar_view.cc View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/login_view.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views.cc View 1 chunk +1 line, -4 lines 0 comments Download
M ui/gfx/render_text.h View 1 chunk +8 lines, -2 lines 0 comments Download
M ui/gfx/render_text.cc View 1 chunk +6 lines, -8 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 chunk +32 lines, -1 line 0 comments Download
M ui/views/controls/message_box_view.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/textfield/native_textfield_views.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/textfield/native_textfield_views.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_views_unittest.cc View 6 chunks +6 lines, -6 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_win.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/textfield/native_textfield_win.cc View 1 3 chunks +12 lines, -11 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_wrapper.h View 1 chunk +4 lines, -3 lines 0 comments Download
M ui/views/controls/textfield/textfield.h View 1 chunk +4 lines, -2 lines 0 comments Download
M ui/views/controls/textfield/textfield.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M ui/views/controls/textfield/textfield_views_model.h View 1 chunk +4 lines, -2 lines 0 comments Download
M ui/views/controls/textfield/textfield_views_model.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M ui/views/controls/textfield/textfield_views_model_unittest.cc View 9 chunks +18 lines, -11 lines 0 comments Download
M ui/views/controls/tree/tree_view_views.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/view_unittest.cc View 6 chunks +11 lines, -11 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
msw
Hey Peter, please take a look and consider these behavioral changes; thanks!
8 years, 5 months ago (2012-07-12 06:47:44 UTC) #1
msw
Amidst actual use, reversed selections seem generally better because they leave (or make) the leading ...
8 years, 5 months ago (2012-07-12 11:13:15 UTC) #2
Peter Kasting
In most cases I think the "panning" effect is OK; for example, if I have ...
8 years, 5 months ago (2012-07-12 18:19:28 UTC) #3
msw
Okay, I flipped the 3 cases mentioned. I think changing Windows tab-traversal behavior (2b) is ...
8 years, 5 months ago (2012-07-12 19:36:27 UTC) #4
Peter Kasting
I think the "Select reversed so we show the beginning in case of overlow" comments ...
8 years, 5 months ago (2012-07-13 00:52:04 UTC) #5
msw
I just decided to remove the redundant comments. I'm going to TBR=ben@chromium.org for ui/views/OWNERS.
8 years, 5 months ago (2012-07-13 01:05:01 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/10693160/5007
8 years, 5 months ago (2012-07-13 01:05:45 UTC) #7
commit-bot: I haz the power
Try job failure for 10693160-5007 (retry) on mac_rel for step "browser_tests". It's a second try, ...
8 years, 5 months ago (2012-07-13 02:09:17 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/10693160/5007
8 years, 5 months ago (2012-07-13 02:47:28 UTC) #9
commit-bot: I haz the power
8 years, 5 months ago (2012-07-13 04:44:57 UTC) #10
Change committed as 146520

Powered by Google App Engine
This is Rietveld 408576698