summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser_commands.cc
diff options
context:
space:
mode:
authorjered@chromium.org <jered@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-17 22:26:45 +0000
committerjered@chromium.org <jered@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-17 22:26:45 +0000
commit9405b38d40e271576e4dd32bc9ad4062a998454a (patch)
treecd02bede518c1b314723be134052b26592468285 /chrome/browser/ui/browser_commands.cc
parent8c5da8a0781836f268b9e98279023180b801a562 (diff)
downloadchromium_src-9405b38d40e271576e4dd32bc9ad4062a998454a.zip
chromium_src-9405b38d40e271576e4dd32bc9ad4062a998454a.tar.gz
chromium_src-9405b38d40e271576e4dd32bc9ad4062a998454a.tar.bz2
InstantExtended: Reload when re-accepting search terms.
Previously when focusing in the omnibox and pressing enter while it showed search results, we would re-classify the match based on the query terms. Instead, we should refresh the search page. Not doing so is a potential security problem and is inconsistent UI behavior, because something that says "Search" should really do a search. TEST=Manually and browsertest BUG=173483,226841 Review URL: https://chromiumcodereview.appspot.com/14752021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200904 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_commands.cc')
-rw-r--r--chrome/browser/ui/browser_commands.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 09eaff5..2c2f27f 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -401,14 +401,19 @@ void OpenCurrentURL(Browser* browser) {
return;
content::PageTransition page_transition = location_bar->GetPageTransition();
+ content::PageTransition page_transition_without_qualifier(
+ PageTransitionStripQualifier(page_transition));
WindowOpenDisposition open_disposition =
location_bar->GetWindowOpenDisposition();
// A PAGE_TRANSITION_TYPED means the user has typed a URL. We do not want to
// open URLs with instant_controller since in some cases it disregards it
// and performs a search instead. For example, when using CTRL-Enter, the
// location_bar is aware of the URL but instant is not.
- if (PageTransitionStripQualifier(page_transition) !=
- content::PAGE_TRANSITION_TYPED &&
+ // Instant should also not handle PAGE_TRANSITION_RELOAD because its knowledge
+ // of the omnibox text may be stale if the user focuses in the omnibox and
+ // presses enter without typing anything.
+ if (page_transition_without_qualifier != content::PAGE_TRANSITION_TYPED &&
+ page_transition_without_qualifier != content::PAGE_TRANSITION_RELOAD &&
browser->instant_controller() &&
browser->instant_controller()->OpenInstant(open_disposition))
return;