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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 9419043: Revert 122412 - Enabled pressing TAB to traverse through the Omnibox results (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 122471)
+++ chrome/browser/ui/views/omnibox/omnibox_view_win.cc (working copy)
@@ -689,22 +689,16 @@
ScopedFreeze freeze(this, GetTextObjectModel());
model_->SetUserText(text);
saved_selection_for_focus_change_.cpMin = -1;
- SetWindowTextAndCaretPos(display_text, display_text.length(), update_popup,
- true);
+ SetWindowTextAndCaretPos(display_text, display_text.length());
+ if (update_popup)
+ UpdatePopup();
+ TextChanged();
}
void OmniboxViewWin::SetWindowTextAndCaretPos(const string16& text,
- size_t caret_pos,
- bool update_popup,
- bool notify_text_changed) {
+ size_t caret_pos) {
SetWindowText(text.c_str());
PlaceCaretAt(caret_pos);
-
- if (update_popup)
- UpdatePopup();
-
- if (notify_text_changed)
- TextChanged();
}
void OmniboxViewWin::SetForcedQuery() {
@@ -744,8 +738,9 @@
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() {
@@ -840,7 +835,8 @@
// 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(), false, true);
+ SetWindowTextAndCaretPos(display_text, display_text.length());
+ TextChanged();
}
bool OmniboxViewWin::OnInlineAutocompleteTextMaybeChanged(
@@ -2091,17 +2087,17 @@
}
case VK_TAB: {
- const bool shift_pressed = GetKeyState(VK_SHIFT) < 0;
- if (model_->is_keyword_hint() && !shift_pressed) {
+ if (model_->is_keyword_hint()) {
// Accept the keyword.
ScopedFreeze freeze(this, GetTextObjectModel());
model_->AcceptKeyword();
- } else if (shift_pressed &&
- model_->popup_model()->selected_line_state() ==
- AutocompletePopupModel::KEYWORD) {
- model_->ClearKeyword(GetText());
+ } else if (!IsCaretAtEnd()) {
+ ScopedFreeze freeze(this, GetTextObjectModel());
+ OnBeforePossibleChange();
+ PlaceCaretAt(GetTextLength());
+ OnAfterPossibleChange();
} else {
- model_->OnUpOrDownKeyPressed(shift_pressed ? -count : count);
+ model_->CommitSuggestedText(true);
}
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