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

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: Ensure the IC.last_match_was_search_ is correctly restored. 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 223c320df5a7b08552eb2b2c6ca7a22ba55eb3cb..80ca2f5d5fe0c7e0ff5203dda403b06d32c07914 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_SearchBoxModeChanged,
OnModeChanged)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxSetDisplayInstantResults,
@@ -229,6 +231,18 @@ void SearchBox::OnUpOrDownKeyPressed(int count) {
}
}
+void SearchBox::OnCancelSelection(const string16& query) {
+ // TODO(sreeram): The state reset below are somewhat wrong. Fix them.
palmer 2013/02/13 21:27:54 I believe it is better to cite a bug # in TODOs.
beaudoin 2013/02/13 21:32:38 Done.
Peter Kasting 2013/02/14 21:17:50 Actually, I ask all my reviewees to not cite bug n
+ 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