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

Unified Diff: chrome/browser/ui/views/find_bar_view.cc

Issue 1305153004: Focus comes on the 'close button' in find bar when selecting 'Enter' key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding test case. Created 5 years, 4 months 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
Index: chrome/browser/ui/views/find_bar_view.cc
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 816e93d3c310c6dc39b6dfd3dbc187ed04f957ef..d9406e24dd6639dd7d52e2f0623d1b49feff9e61 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -406,12 +406,14 @@ void FindBarView::ButtonPressed(
sender->tag() == FIND_NEXT_TAG,
false); // Not case sensitive.
}
- if (event.IsMouseEvent()) {
- // If mouse event, we move the focus back to the text-field, so that the
- // user doesn't have to click on the text field to change the search. We
- // don't want to do this for keyboard clicks on the button, since the
- // user is more likely to press FindNext again than change the search
- // query.
+ // As NotifyClick() now takes ui::Event directly so event can be mouse
+ // event or the key event.
+ if (event.IsMouseEvent() || (event.IsKeyEvent() &&
+ static_cast<const ui::KeyEvent&>(event)
+ .key_code() == ui::VKEY_RETURN)) {
msw 2015/08/26 18:44:32 The same defect occurs for the space key, and perh
Deepak 2015/08/27 05:31:04 Thanks for detailed explanation. As the current is
msw 2015/08/27 18:09:02 Acknowledged.
+ // If mouse event or key event with Enter key, we move the focus back
+ // to the text-field, so that the user doesn't have to click on the
+ // text field to change the search.
find_text_->RequestFocus();
}
break;

Powered by Google App Engine
This is Rietveld 408576698