Chromium Code Reviews| Index: chrome/browser/ui/search/instant_controller.cc |
| diff --git a/chrome/browser/ui/search/instant_controller.cc b/chrome/browser/ui/search/instant_controller.cc |
| index e478acac7cffe7ee74b487e7d5935b851b42834e..20c580db363e36c93c2b0686f97eeb1fbc54c839 100644 |
| --- a/chrome/browser/ui/search/instant_controller.cc |
| +++ b/chrome/browser/ui/search/instant_controller.cc |
| @@ -379,16 +379,15 @@ bool InstantController::Update(const AutocompleteMatch& match, |
| // tab), by comparing the old and new WebContents. |
| if (escape_pressed && |
| instant_tab_->contents() == browser_->GetActiveWebContents()) { |
| - // If the omnibox is blank, send an onchange("") instead of an |
| - // onsubmit(""). This is to avoid confusion with the onsubmit("") |
| - // that we send when the user hits Enter to navigate to a URL. |
| - // onchange("") is used for a similar situation with the overlay |
| - // (when the overlay is dismissed because the user hit Escape); it |
| - // does the right thing for committed tabs as well. |
| - if (full_text.empty()) |
| + // TODO(kmadhusu): If the |full_text| is not empty, send an |
| + // onkeypress(esc) to the Instant page. Do not call |
| + // onsubmit(full_text). Fix. |
| + if (full_text.empty()) { |
| instant_tab_->Update(string16(), 0, 0, true); |
|
samarth
2013/05/06 19:13:37
Please add a comment for this call: because that w
kmadhusu
2013/05/06 20:24:44
Done.
|
| - else |
| + instant_tab_->EscKeyPressed(); |
| + } else { |
| instant_tab_->Submit(full_text); |
| + } |
| } |
| } else if (!full_text.empty()) { |
| // If |full_text| is empty, the user is on the NTP. The overlay may |