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

Unified Diff: chrome/renderer/searchbox/searchbox.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/renderer/searchbox/searchbox.h ('k') | chrome/renderer/searchbox/searchbox_extension.h » ('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 e4dd30407fbfb12691350e28778ae45a01b7f428..396005c07616d4e6cb17d95c3dc2ce845b4c8e54 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -122,6 +122,8 @@ bool SearchBox::OnMessageReceived(const IPC::Message& message) {
OnAutocompleteResults)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxUpOrDownKeyPressed,
OnUpOrDownKeyPressed)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxCancelSelection,
+ OnCancelSelection)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxSetDisplayInstantResults,
OnSetDisplayInstantResults)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxKeyCaptureChanged,
@@ -227,6 +229,18 @@ void SearchBox::OnUpOrDownKeyPressed(int count) {
}
}
+void SearchBox::OnCancelSelection(const string16& query) {
+ // TODO(sreeram): crbug.com/176101 The state reset below are somewhat wrong.
+ query_ = query;
+ verbatim_ = true;
+ selection_start_ = selection_end_ = query_.size();
+ if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
+ DVLOG(1) << render_view() << " OnKeyPress ESC";
+ extensions_v8::SearchBoxExtension::DispatchEscKeyPress(
+ render_view()->GetWebView()->mainFrame());
+ }
+}
+
void SearchBox::OnKeyCaptureChange(bool is_key_capture_enabled) {
if (is_key_capture_enabled != is_key_capture_enabled_ &&
render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
« no previous file with comments | « chrome/renderer/searchbox/searchbox.h ('k') | chrome/renderer/searchbox/searchbox_extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698