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

Unified Diff: chrome/browser/ui/search/search.cc

Issue 11876045: [Search] Store and recall search terms using NavigationEntry to improve search term extraction (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: reupload Created 7 years, 11 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/ui/search/search.h ('k') | content/browser/web_contents/navigation_entry_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/search.cc
diff --git a/chrome/browser/ui/search/search.cc b/chrome/browser/ui/search/search.cc
index 796edb4ee64bf23013c73c455ea65b7d8c84b63d..71123712d5c49c13e2c29e173848483e8cc3e6ab 100644
--- a/chrome/browser/ui/search/search.cc
+++ b/chrome/browser/ui/search/search.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
+#include "content/public/browser/navigation_entry.h"
#if !defined(OS_ANDROID)
#include "chrome/browser/themes/theme_service.h"
@@ -46,6 +47,9 @@ const char kDisablingSuffix[] = "DISABLED";
namespace chrome {
namespace search {
+// static
+const char kInstantExtendedSearchTermsKey[] = "search_terms";
+
// Check whether or not the Extended API should be used on the given profile.
bool IsInstantExtendedAPIEnabled(Profile* profile) {
return EmbeddedSearchPageVersion(profile) != 0;
@@ -139,6 +143,13 @@ void EnableQueryExtractionForTesting() {
#endif
}
+string16 GetSearchTermsFromNavigationEntry(
+ const content::NavigationEntry* entry) {
+ string16 search_terms;
+ entry->GetExtraData(kInstantExtendedSearchTermsKey, &search_terms);
+ return search_terms;
+}
+
bool IsForcedInstantURL(const GURL& url) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kInstantURL))
« no previous file with comments | « chrome/browser/ui/search/search.h ('k') | content/browser/web_contents/navigation_entry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698