Chromium Code Reviews| 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; |