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

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

Issue 215733002: Add support to enable EmbeddedSearch API in Android Chrome search results page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: chrome/browser/android/tab_android.cc
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index 773d1f047f9eb4250ad17419dfef609ff0b9519b..a362bf2a3c2a0d1334a986d94f09d0bc6a929b37 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_android.h"
+#include "chrome/browser/search/search.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/sync/glue/synced_tab_delegate_android.h"
#include "chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.h"
@@ -30,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/search_tab_helper.h"
#include "chrome/browser/ui/tab_contents/core_tab_helper.h"
#include "chrome/browser/ui/tab_helpers.h"
#include "chrome/browser/ui/toolbar/toolbar_model_impl.h"
@@ -461,6 +463,15 @@ TabAndroid::TabLoadStatus TabAndroid::LoadUrl(JNIEnv* env,
GURL(base::android::ConvertJavaStringToUTF8(env, j_referrer_url)),
static_cast<blink::WebReferrerPolicy>(referrer_policy));
}
+ const base::string16 search_terms =
+ chrome::ExtractSearchTermsFromURL(GetProfile(), gurl);
+ SearchTabHelper* search_tab_helper =
+ SearchTabHelper::FromWebContents(web_contents_.get());
+ if (!search_terms.empty() && search_tab_helper &&
+ search_tab_helper->SupportsInstant()) {
+ search_tab_helper->Submit(search_terms);
+ return DEFAULT_PAGE_LOAD;
samarth 2014/04/25 06:50:20 Is this the right return type here?
kmadhusu 2014/04/25 17:23:19 Ted@, Is this okay? Do you want me to create a new
Ted C 2014/04/29 16:53:13 This should be fine. This isn't a prerendered pag
kmadhusu 2014/04/29 17:01:30 Loading progress bar is shown while going through
+ }
content_view->LoadUrl(load_params);
}
return DEFAULT_PAGE_LOAD;

Powered by Google App Engine
This is Rietveld 408576698