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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 6731036: Enabled pressing TAB to cycle through the Omnibox results. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 } 981 }
982 982
983 std::string LocationBarView::GetClassName() const { 983 std::string LocationBarView::GetClassName() const {
984 return kViewClassName; 984 return kViewClassName;
985 } 985 }
986 986
987 bool LocationBarView::SkipDefaultKeyEventProcessing( 987 bool LocationBarView::SkipDefaultKeyEventProcessing(
988 const views::KeyEvent& event) { 988 const views::KeyEvent& event) {
989 #if defined(OS_WIN) 989 #if defined(OS_WIN)
990 if (views::FocusManager::IsTabTraversalKeyEvent(event)) { 990 if (views::FocusManager::IsTabTraversalKeyEvent(event)) {
991 if (HasValidSuggestText()) { 991 return location_entry_->model()->popup_model()->IsOpen() ||
992 // Return true so that the edit sees the tab and commits the suggestion. 992 (keyword_hint_view_->IsVisible() && !event.IsShiftDown());
993 return true;
994 }
995 if (keyword_hint_view_->IsVisible() && !event.IsShiftDown()) {
996 // Return true so the edit gets the tab event and enters keyword mode.
997 return true;
998 }
999
1000 // If the caret is not at the end, then tab moves the caret to the end.
1001 if (!location_entry_->IsCaretAtEnd())
1002 return true;
1003
1004 // Tab while showing instant commits instant immediately.
1005 // Return true so that focus traversal isn't attempted. The edit ends
1006 // up doing nothing in this case.
1007 if (location_entry_->model()->AcceptCurrentInstantPreview())
1008 return true;
1009 } 993 }
1010 994
1011 return location_entry_->SkipDefaultKeyEventProcessing(event); 995 return location_entry_->SkipDefaultKeyEventProcessing(event);
1012 #else 996 #else
1013 // This method is not used for Linux ports. See FocusManager::OnKeyEvent() in 997 // This method is not used for Linux ports. See FocusManager::OnKeyEvent() in
1014 // src/views/focus/focus_manager.cc for details. 998 // src/views/focus/focus_manager.cc for details.
1015 return false; 999 return false;
1016 #endif 1000 #endif
1017 } 1001 }
1018 1002
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 template_url_model_ = NULL; 1166 template_url_model_ = NULL;
1183 ShowFirstRunBubble(bubble_type_); 1167 ShowFirstRunBubble(bubble_type_);
1184 } 1168 }
1185 1169
1186 #if defined(OS_WIN) 1170 #if defined(OS_WIN)
1187 bool LocationBarView::HasValidSuggestText() const { 1171 bool LocationBarView::HasValidSuggestText() const {
1188 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && 1172 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() &&
1189 !suggested_text_view_->GetText().empty(); 1173 !suggested_text_view_->GetText().empty();
1190 } 1174 }
1191 #endif 1175 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698