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

Unified Diff: chrome/renderer/searchbox/searchbox.cc

Issue 14562006: Handle Esc key press event in Local NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git cl upload Created 7 years, 7 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/renderer/searchbox/searchbox.h ('k') | chrome/test/data/instant_extended.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox.cc
diff --git a/chrome/renderer/searchbox/searchbox.cc b/chrome/renderer/searchbox/searchbox.cc
index 604fa169bbd8a1fd69074e42a7c4beb9f7ca2d1f..d72a60cb974e1980cc468d7c80dacee9f005c40e 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -196,6 +196,7 @@ bool SearchBox::OnMessageReceived(const IPC::Message& message) {
OnAutocompleteResults)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxUpOrDownKeyPressed,
OnUpOrDownKeyPressed)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxEscKeyPressed, OnEscKeyPressed)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxCancelSelection,
OnCancelSelection)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxSetDisplayInstantResults,
@@ -330,6 +331,14 @@ void SearchBox::OnUpOrDownKeyPressed(int count) {
}
}
+void SearchBox::OnEscKeyPressed() {
+ if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
+ DVLOG(1) << render_view() << " OnEscKeyPressed ";
+ extensions_v8::SearchBoxExtension::DispatchEscKeyPress(
+ render_view()->GetWebView()->mainFrame());
+ }
+}
+
void SearchBox::OnCancelSelection(const string16& query,
bool verbatim,
size_t selection_start,
« no previous file with comments | « chrome/renderer/searchbox/searchbox.h ('k') | chrome/test/data/instant_extended.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698