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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.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 8 years, 11 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 | « chrome/browser/ui/views/omnibox/omnibox_view_win.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
===================================================================
--- chrome/browser/ui/views/omnibox/omnibox_view_win.cc (revision 119905)
+++ chrome/browser/ui/views/omnibox/omnibox_view_win.cc (working copy)
@@ -689,16 +689,22 @@
ScopedFreeze freeze(this, GetTextObjectModel());
model_->SetUserText(text);
saved_selection_for_focus_change_.cpMin = -1;
- SetWindowTextAndCaretPos(display_text, display_text.length());
- if (update_popup)
- UpdatePopup();
- TextChanged();
+ SetWindowTextAndCaretPos(display_text, display_text.length(), update_popup,
+ true);
}
void OmniboxViewWin::SetWindowTextAndCaretPos(const string16& text,
- size_t caret_pos) {
+ size_t caret_pos,
+ bool update_popup,
+ bool notify_text_changed) {
SetWindowText(text.c_str());
PlaceCaretAt(caret_pos);
+
+ if (update_popup)
+ UpdatePopup();
+
+ if (notify_text_changed)
+ TextChanged();
}
void OmniboxViewWin::SetForcedQuery() {
@@ -738,9 +744,8 @@
void OmniboxViewWin::RevertAll() {
ScopedFreeze freeze(this, GetTextObjectModel());
ClosePopup();
+ saved_selection_for_focus_change_.cpMin = -1;
model_->Revert();
- saved_selection_for_focus_change_.cpMin = -1;
- TextChanged();
}
void OmniboxViewWin::UpdatePopup() {
@@ -835,8 +840,7 @@
// text and then arrowed to another entry with the same text, we'd still want
// to move the caret.
ScopedFreeze freeze(this, GetTextObjectModel());
- SetWindowTextAndCaretPos(display_text, display_text.length());
- TextChanged();
+ SetWindowTextAndCaretPos(display_text, display_text.length(), false, true);
}
bool OmniboxViewWin::OnInlineAutocompleteTextMaybeChanged(
@@ -2087,17 +2091,17 @@
}
case VK_TAB: {
- if (model_->is_keyword_hint()) {
+ const bool shift_pressed = GetKeyState(VK_SHIFT) < 0;
+ if (model_->is_keyword_hint() && !shift_pressed) {
// Accept the keyword.
ScopedFreeze freeze(this, GetTextObjectModel());
model_->AcceptKeyword();
- } else if (!IsCaretAtEnd()) {
- ScopedFreeze freeze(this, GetTextObjectModel());
- OnBeforePossibleChange();
- PlaceCaretAt(GetTextLength());
- OnAfterPossibleChange();
+ } else if (shift_pressed &&
+ model_->popup_model()->selected_line_state() ==
+ AutocompletePopupModel::KEYWORD) {
+ model_->ClearKeyword(GetText());
} else {
- model_->CommitSuggestedText(true);
+ model_->OnUpOrDownKeyPressed(shift_pressed ? -count : count);
}
return true;
}
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698