Chromium Code Reviews
DescriptionAdd 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. #Messages
Total messages: 10 (0 generated)
|