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

Unified Diff: chrome/browser/autocomplete/autocomplete_input.h

Issue 12623029: Upstreaming mechanism to add query refinement to omnibox searches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed ChromeOS. Created 7 years, 9 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/autocomplete/autocomplete_input.h
diff --git a/chrome/browser/autocomplete/autocomplete_input.h b/chrome/browser/autocomplete/autocomplete_input.h
index 7e0ab3dd66e60e09210f6f96594764dae0aece03..68247bcc381d736985fb778fa91edcee5622877b 100644
--- a/chrome/browser/autocomplete/autocomplete_input.h
+++ b/chrome/browser/autocomplete/autocomplete_input.h
@@ -55,6 +55,10 @@ class AutocompleteInput {
// "www." should be prepended to the domain where possible. The |desired_tld|
// should not contain a leading '.' (use "com" instead of ".com").
//
+ // If |current_url| is set to a valid search result page URL, providers can
+ // use it to perform query refinement. For example, if it is set to an image
+ // search result page, the search provider will generate an image search URL.
Peter Kasting 2013/03/22 20:20:06 Nit: will -> may I don't see any place in this ch
beaudoin 2013/03/22 23:10:43 Done.
+ //
// |prevent_inline_autocomplete| is true if the generated result set should
// not require inline autocomplete for the default match. This is difficult
// to explain in the abstract; the practical use case is that after the user
@@ -76,6 +80,7 @@ class AutocompleteInput {
AutocompleteInput(const string16& text,
size_t cursor_position,
const string16& desired_tld,
+ const GURL& current_url,
bool prevent_inline_autocomplete,
bool prefer_keyword,
bool allow_exact_keyword_match,
@@ -135,6 +140,9 @@ class AutocompleteInput {
size_t cursor_position,
const url_parse::Parsed& parts);
+ // The current URL, or an invalid GURL if query refinement is not desired.
+ const GURL& current_url() const { return current_url_; }
+
// The type of input supplied.
Type type() const { return type_; }
@@ -173,6 +181,7 @@ class AutocompleteInput {
// method.
string16 text_;
size_t cursor_position_;
+ GURL current_url_;
Type type_;
url_parse::Parsed parts_;
string16 scheme_;

Powered by Google App Engine
This is Rietveld 408576698