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

Unified Diff: chrome/browser/android/tab_android.cc

Issue 321943002: Prefetch high-confidence search suggestions in Android Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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/browser/android/omnibox/omnibox_prerender.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/tab_android.cc
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index b74feb4cb4186579678dda99b1e3cd332d4d0285..dcf45ca509ce865b855a11eea7809623eea19944 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -31,6 +31,7 @@
#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
#include "chrome/browser/ui/android/window_android_helper.h"
#include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h"
+#include "chrome/browser/ui/search/instant_search_prerenderer.h"
#include "chrome/browser/ui/search/search_tab_helper.h"
#include "chrome/browser/ui/tab_contents/core_tab_helper.h"
#include "chrome/browser/ui/tab_helpers.h"
@@ -395,6 +396,20 @@ TabAndroid::TabLoadStatus TabAndroid::LoadUrl(JNIEnv* env,
bool prefetched_page_loaded = HasPrerenderedUrl(gurl);
// Getting the load status before MaybeUsePrerenderedPage() b/c it resets.
chrome::NavigateParams params(NULL, web_contents());
+ InstantSearchPrerenderer* prerenderer =
+ InstantSearchPrerenderer::GetForProfile(GetProfile());
+ if (prerenderer) {
+ const base::string16& search_terms =
+ chrome::ExtractSearchTermsFromURL(GetProfile(), gurl);
+ if (!search_terms.empty() &&
+ prerenderer->CanCommitQuery(web_contents_.get(), search_terms)) {
+ prerenderer->Commit(search_terms);
+
+ if (prerenderer->UsePrerenderedPage(gurl, &params))
+ return FULL_PRERENDERED_PAGE_LOAD;
+ }
+ prerenderer->Cancel();
+ }
if (prerender_manager->MaybeUsePrerenderedPage(gurl, &params)) {
return prefetched_page_loaded ?
FULL_PRERENDERED_PAGE_LOAD : PARTIAL_PRERENDERED_PAGE_LOAD;
« no previous file with comments | « chrome/browser/android/omnibox/omnibox_prerender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698