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

Side by Side Diff: chrome/browser/search/search.h

Issue 151813002: Adds InstantExtendedEnabledParam to the search request URL iff the query extraction flag is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider.cc ('k') | chrome/browser/search/search.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SEARCH_SEARCH_H_ 5 #ifndef CHROME_BROWSER_SEARCH_SEARCH_H_
6 #define CHROME_BROWSER_SEARCH_SEARCH_H_ 6 #define CHROME_BROWSER_SEARCH_SEARCH_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool IsInstantExtendedAPIEnabled(); 71 bool IsInstantExtendedAPIEnabled();
72 72
73 // Returns whether the suggest is enabled for the given |profile|. 73 // Returns whether the suggest is enabled for the given |profile|.
74 bool IsSuggestPrefEnabled(Profile* profile); 74 bool IsSuggestPrefEnabled(Profile* profile);
75 75
76 // Returns the value to pass to the &espv CGI parameter when loading the 76 // Returns the value to pass to the &espv CGI parameter when loading the
77 // embedded search page from the user's default search provider. Returns 0 if 77 // embedded search page from the user's default search provider. Returns 0 if
78 // the Instant Extended API is not enabled. 78 // the Instant Extended API is not enabled.
79 uint64 EmbeddedSearchPageVersion(); 79 uint64 EmbeddedSearchPageVersion();
80 80
81 // Returns a string indicating whether InstantExtended is enabled, suitable
82 // for adding as a query string param to the homepage or search requests.
83 // Returns an empty string otherwise.
84 //
85 // |for_search| should be set to true for search requests, in which case this
86 // returns a non-empty string only if query extraction is enabled.
87 std::string InstantExtendedEnabledParam(bool for_search);
88
81 // Returns whether query extraction is enabled. 89 // Returns whether query extraction is enabled.
82 bool IsQueryExtractionEnabled(); 90 bool IsQueryExtractionEnabled();
83 91
84 // Extracts and returns search terms from |url|. Returns empty string if the URL 92 // Extracts and returns search terms from |url|. Returns empty string if the URL
85 // is not secure or doesn't have a search term replacement key. Does not 93 // is not secure or doesn't have a search term replacement key. Does not
86 // consider IsQueryExtractionEnabled() and Instant support state of the page and 94 // consider IsQueryExtractionEnabled() and Instant support state of the page and
87 // does not check for a privileged process, so most callers should use 95 // does not check for a privileged process, so most callers should use
88 // GetSearchTerms() below instead. 96 // GetSearchTerms() below instead.
89 base::string16 GetSearchTermsFromURL(Profile* profile, const GURL& url); 97 base::string16 GetSearchTermsFromURL(Profile* profile, const GURL& url);
90 98
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 bool GetBoolValueForFlagWithDefault(const std::string& flag, 282 bool GetBoolValueForFlagWithDefault(const std::string& flag,
275 bool default_value, 283 bool default_value,
276 const FieldTrialFlags& flags); 284 const FieldTrialFlags& flags);
277 285
278 // Returns the Cacheable New Tab Page URL for the given |profile|. 286 // Returns the Cacheable New Tab Page URL for the given |profile|.
279 GURL GetNewTabPageURL(Profile* profile); 287 GURL GetNewTabPageURL(Profile* profile);
280 288
281 } // namespace chrome 289 } // namespace chrome
282 290
283 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ 291 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider.cc ('k') | chrome/browser/search/search.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698