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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.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, 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 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/omnibox/omnibox_view_views.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } else if (!handled && event.key_code() == ui::VKEY_UP) { 208 } else if (!handled && event.key_code() == ui::VKEY_UP) {
209 model_->OnUpOrDownKeyPressed(-1); 209 model_->OnUpOrDownKeyPressed(-1);
210 handled = true; 210 handled = true;
211 } else if (!handled && event.key_code() == ui::VKEY_DOWN) { 211 } else if (!handled && event.key_code() == ui::VKEY_DOWN) {
212 model_->OnUpOrDownKeyPressed(1); 212 model_->OnUpOrDownKeyPressed(1);
213 handled = true; 213 handled = true;
214 } else if (!handled && 214 } else if (!handled &&
215 event.key_code() == ui::VKEY_TAB && 215 event.key_code() == ui::VKEY_TAB &&
216 !event.IsShiftDown() && 216 !event.IsShiftDown() &&
217 !event.IsControlDown()) { 217 !event.IsControlDown()) {
218 if (model_->is_keyword_hint()) { 218 if (model_->is_keyword_hint() && !event.IsShiftDown()) {
219 handled = model_->AcceptKeyword(); 219 handled = model_->AcceptKeyword();
220 } else if (model_->popup_model()->IsOpen()) {
221 model_->OnUpOrDownKeyPressed(event.IsShiftDown() ? -1 : 1);
222 handled = true;
220 } else { 223 } else {
221 string16::size_type start = 0; 224 string16::size_type start = 0;
222 string16::size_type end = 0; 225 string16::size_type end = 0;
223 size_t length = GetTextLength(); 226 size_t length = GetTextLength();
224 GetSelectionBounds(&start, &end); 227 GetSelectionBounds(&start, &end);
225 if (start != end || start < length) { 228 if (start != end || start < length) {
226 OnBeforePossibleChange(); 229 OnBeforePossibleChange();
227 SelectRange(length, length); 230 SelectRange(length, length);
228 OnAfterPossibleChange(); 231 OnAfterPossibleChange();
229 handled = true; 232 handled = true;
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 normal_text_style_ = textfield_->CreateTextStyle(); 709 normal_text_style_ = textfield_->CreateTextStyle();
707 security_error_scheme_style_ = textfield_->CreateTextStyle(); 710 security_error_scheme_style_ = textfield_->CreateTextStyle();
708 secure_scheme_style_ = textfield_->CreateTextStyle(); 711 secure_scheme_style_ = textfield_->CreateTextStyle();
709 712
710 faded_text_style_->set_foreground(kFadedTextColor); 713 faded_text_style_->set_foreground(kFadedTextColor);
711 normal_text_style_->set_foreground(kNormalTextColor); 714 normal_text_style_->set_foreground(kNormalTextColor);
712 secure_scheme_style_->set_foreground(kSecureSchemeColor); 715 secure_scheme_style_->set_foreground(kSecureSchemeColor);
713 security_error_scheme_style_->set_foreground(kSecurityErrorSchemeColor); 716 security_error_scheme_style_->set_foreground(kSecurityErrorSchemeColor);
714 security_error_scheme_style_->set_strike(true); 717 security_error_scheme_style_->set_strike(true);
715 } 718 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698