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

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

Issue 11889003: Fixing ESC in instant-extended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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/instant/instant_controller.h ('k') | chrome/browser/instant/instant_extended_browsertest.cc » ('j') | 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 7c1c8b2aec6cd5eaa136be37aa7dbec3d7d19a80..1f25d3dcd13e074eb7abeee3c1769436ff1e8504 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -507,6 +507,27 @@ bool InstantController::OnUpOrDownKeyPressed(int count) {
return true;
}
+void InstantController::OnCancel(const AutocompleteMatch& match,
+ const string16& full_text) {
+ if (!extended_enabled_)
+ return;
+
+ if (!instant_tab_ && !overlay_)
+ return;
+
+ // We manually reset the state here since the JS is not expected to do it.
+ // TODO(sreeram): Handle the case where user_text is now a URL
+ last_match_was_search_ = AutocompleteMatch::IsSearchType(match.type) &&
+ !full_text.empty();
+ last_omnibox_text_ = full_text;
+ last_suggestion_ = InstantSuggestion();
+
+ if (instant_tab_)
+ instant_tab_->CancelSelection(full_text);
+ else
+ overlay_->CancelSelection(full_text);
+}
+
content::WebContents* InstantController::GetPreviewContents() const {
return overlay_ ? overlay_->contents() : NULL;
}
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/browser/instant/instant_extended_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698