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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 12895007: Send onsubmit query down to the instant extended overlay page when a navigation is performed from t… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check return value of UpdateSearchState. Created 7 years, 8 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 | « no previous file | chrome/browser/ui/search/instant_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_edit_model.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index ff3e0fdf807670f05da05cea814aaf65656a3fdb..0197b3ff52a1c31792b0e63379a3e937658a8c5a 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -713,6 +713,19 @@ void OmniboxEditModel::OpenMatch(const AutocompleteMatch& match,
base::TimeTicks::Now() - time_user_first_modified_omnibox_;
const GURL destination_url = autocomplete_controller_->
GetDestinationURL(match, query_formulation_time);
+
+ // If running with instant, notify the instant controller that a navigation
+ // is about to take place if we are navigating to a URL. This can be
+ // determined by inspecting the transition type. To ensure that this is only
+ // done on Enter key press, check that the disposition is CURRENT_TAB. This
+ // is the same heuristic used by BrowserInstantController::OpenInstant
+ if (match.transition == content::PAGE_TRANSITION_TYPED &&
+ disposition == CURRENT_TAB) {
+ InstantController* instant = controller_->GetInstant();
+ if (instant)
+ instant->OmniboxNavigateToURL();
+ }
+
// This calls RevertAll again.
base::AutoReset<bool> tmp(&in_revert_, true);
controller_->OnAutocompleteAccept(destination_url, disposition,
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698