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

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

Issue 23621037: Send URLs on non-zero prefix suggest requests also. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move set_current_page_url Created 7 years, 3 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/search_provider.h
diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h
index 5993a46e73f72356e40ec1a5d1331533dcb6b1b1..4a3a42ec1cdb0caff7d380c75f8d810b42774eb9 100644
--- a/chrome/browser/autocomplete/search_provider.h
+++ b/chrome/browser/autocomplete/search_provider.h
@@ -106,6 +106,11 @@ class SearchProvider : public AutocompleteProvider,
return field_trial_triggered_in_session_;
}
+ // This URL may be sent with suggest requests; see comments on CanSendURL().
+ void set_current_page_url(const GURL& url) {
Peter Kasting 2013/10/08 01:10:25 Tiny nit: Name the arg |current_page_url|
H Fung 2013/10/30 23:56:15 Done.
+ current_page_url_ = url;
+ }
+
private:
// TODO(hfung): Remove ZeroSuggestProvider as a friend class after
// refactoring common code to a new base class.
@@ -492,6 +497,14 @@ class SearchProvider : public AutocompleteProvider,
// Updates the value of |done_| from the internal state.
void UpdateDone();
+ // Whether the URL can be sent in the suggest request. Don't send the URL of
+ // non-Google HTTPS requests because it may contain sensitive information.
Peter Kasting 2013/10/08 01:10:25 Nit: This sentence is kinda redundant with the one
H Fung 2013/10/30 23:56:15 Done.
+ // Don't allow incognito, if suggest is disabled, if they don't have
Peter Kasting 2013/10/08 01:10:25 Nit: incognito -> if Chrome is incognito?
H Fung 2013/10/30 23:56:15 Done.
+ // unencrypted tab sync enabled, or if Google is not their search provider.
Peter Kasting 2013/10/08 01:10:25 Nit: their -> the user's
H Fung 2013/10/30 23:56:15 Done.
+ // Checking that the user is in a field trial is done elsewhere.
Peter Kasting 2013/10/08 01:10:25 This line seems to be false now.
H Fung 2013/10/30 23:56:15 Done.
+ static bool CanSendURL(const GURL& url, const TemplateURL* template_url,
Peter Kasting 2013/10/08 01:10:25 Nit: One arg per line
H Fung 2013/10/30 23:56:15 Done.
+ Profile* profile);
+
// The amount of time to wait before sending a new suggest request after the
// previous one. Non-const because some unittests modify this value.
static int kMinimumTimeBetweenSuggestQueriesMs;
@@ -561,6 +574,8 @@ class SearchProvider : public AutocompleteProvider,
// they will not be inlined.
bool prevent_search_history_inlining_;
+ GURL current_page_url_;
+
DISALLOW_COPY_AND_ASSIGN(SearchProvider);
};
« no previous file with comments | « no previous file | chrome/browser/autocomplete/search_provider.cc » ('j') | chrome/browser/autocomplete/search_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698