Commit 51899422 authored by kmadhusu's avatar kmadhusu Committed by Commit bot

Add an alternate contextual search url to extract the search terms from window.location.hash.

BUG=456353

Review URL: https://codereview.chromium.org/922793002

Cr-Commit-Position: refs/heads/master@{#316370}
parent bc67ebb2
......@@ -92,7 +92,7 @@ EmbeddedSearchRequestParams::EmbeddedSearchRequestParams() {
}
EmbeddedSearchRequestParams::EmbeddedSearchRequestParams(const GURL& url) {
const std::string& url_params(url.query());
const std::string& url_params(url.ref().empty()? url.query() : url.ref());
url::Component query, key, value;
query.len = static_cast<int>(url_params.size());
......
......@@ -49,6 +49,13 @@ TEST(EmbeddedSearchRequestParams, ExtractParams) {
"utf-8",
"chrome.2.65.j04"
},
{"https://foo/search?q=google#q=fun&oq=f&ie=utf-8&aqs=chrome.0.1",
"fun",
"f",
"",
"utf-8",
"chrome.0.1"
},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
......
......@@ -30,7 +30,7 @@
// Increment this if you change the data in ways that mean users with
// existing data should get a new version.
"kCurrentDataVersion": 80
"kCurrentDataVersion": 81
},
// The following engines are included in country lists and are added to the
......@@ -120,6 +120,7 @@
"{google:baseURL}#q={searchTerms}",
"{google:baseURL}search#q={searchTerms}",
"{google:baseURL}webhp#q={searchTerms}",
"{google:baseURL}s#q={searchTerms}",
"{google:baseURL}s?q={searchTerms}"
],
"search_terms_replacement_key": "{google:instantExtendedEnabledKey}",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment