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

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: Reworked to send ESC down to JS, added test. 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
Index: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 72bf030cf4622bae5a435a0db432785e8f48649f..97d7c694a91d32bb8f93746d36281d3c824854a5 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -492,6 +492,21 @@ bool InstantController::OnUpOrDownKeyPressed(int count) {
return true;
}
+bool InstantController::OnCancel() {
+ if (!extended_enabled_)
+ return false;
+
+ if (!instant_tab_ && !loader_)
+ return false;
+
+ if (instant_tab_)
+ instant_tab_->EscKeyPressed();
+ else
+ loader_->EscKeyPressed();
+
+ return true;
+}
+
content::WebContents* InstantController::GetPreviewContents() const {
return loader_ ? loader_->contents() : NULL;
}

Powered by Google App Engine
This is Rietveld 408576698