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

Unified Diff: chrome/browser/instant/instant_controller.cc

Issue 12035083: [Instant] Update InstantController state to ensure valid subsequent queries (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 1fdec4c65816ea0925a8801d1d2a135a45dad2b5..7418c790ff63d5cfdeadeea06459d0a62b6247bb 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -549,6 +549,9 @@ bool InstantController::CommitIfPossible(InstantCommitType type) {
net::EscapeQueryParamValue(query, true)));
chrome::search::SearchTabHelper::FromWebContents(preview)->
NavigationEntryUpdated();
+ // Update |last_omnibox_text_| so that the controller commits the proper
+ // query if the user focuses the omnibox and presses Enter.
+ last_omnibox_text_ = ASCIIToUTF16(query);
sreeram 2013/01/24 22:54:32 You only need to do this if we hit the "if" condit
Mathieu 2013/01/28 18:50:32 Done.
}
}
@@ -743,8 +746,9 @@ void InstantController::SetSuggestions(
// This means a committed page in state search called setValue(). We should
// update the omnibox to reflect what the search page says.
browser_->SetInstantSuggestion(suggestion);
- // Don't update last_omnibox_text_ or last_suggestion_ since the user is not
- // currently editing text in the omnibox.
+ // Update |last_omnibox_text_| so that the controller commits the proper
+ // query if the user focuses the omnibox and presses Enter.
+ last_omnibox_text_ = suggestion.text;
sreeram 2013/01/24 22:54:32 Put this above the call to browser_->SetInstantSug
Mathieu 2013/01/28 18:50:32 Okay, copied the lines over there.
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698