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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc

Issue 151209: Initial work on Linux tab to search. (Closed)
Patch Set: Dan's comments. Created 11 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index 1ee5a15327400d4307d27690136da4b433518f47..1baabef4b209091cd0cca5f643958b0c7ff56cf2 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -459,6 +459,7 @@ gboolean AutocompleteEditViewGtk::HandleKeyPress(GtkWidget* widget,
if (event->keyval == GDK_Return ||
event->keyval == GDK_ISO_Enter ||
event->keyval == GDK_KP_Enter ||
+ event->keyval == GDK_Tab ||
(event->keyval == GDK_Escape && event->state == 0)) {
// Handle IME. This is basically taken from GtkTextView and reworked a bit.
GtkTextIter iter;
@@ -475,7 +476,13 @@ gboolean AutocompleteEditViewGtk::HandleKeyPress(GtkWidget* widget,
}
} else {
// Ok, not handled by the IME, we can handle it.
- if (event->keyval == GDK_Escape) {
+ if (event->keyval == GDK_Tab) {
+ if (model_->is_keyword_hint() && !model_->keyword().empty()) {
+ model_->AcceptKeyword();
+ } else {
+ return FALSE; // Let GtkTextView handle the tab focus change.
+ }
+ } else if (event->keyval == GDK_Escape) {
model_->OnEscapeKeyPressed();
} else {
bool alt_held = (event->state & GDK_MOD1_MASK);
« no previous file with comments | « no previous file | chrome/browser/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698