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

Side by Side Diff: chrome/browser/search_engines/template_url.h

Issue 10537154: A working implementation of AQS (Assisted Query Stats). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_ENGINES_TEMPLATE_URL_H_ 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // the key of the search term, otherwise this returns an empty string. 104 // the key of the search term, otherwise this returns an empty string.
105 const std::string& GetSearchTermKey() const; 105 const std::string& GetSearchTermKey() const;
106 106
107 // Converts the specified term in our owner's encoding to a string16. 107 // Converts the specified term in our owner's encoding to a string16.
108 string16 SearchTermToString16(const std::string& term) const; 108 string16 SearchTermToString16(const std::string& term) const;
109 109
110 // Returns true if this TemplateURLRef has a replacement term of 110 // Returns true if this TemplateURLRef has a replacement term of
111 // {google:baseURL} or {google:baseSuggestURL}. 111 // {google:baseURL} or {google:baseSuggestURL}.
112 bool HasGoogleBaseURLs() const; 112 bool HasGoogleBaseURLs() const;
113 113
114 // Returns true iff this TemplateURLRef has a replacement term of
115 // {goog:assistedQueryStats}.
116 bool SupportsAssistedQueryStats() const;
117
114 private: 118 private:
115 friend class TemplateURL; 119 friend class TemplateURL;
116 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, SetPrepopulatedAndParse); 120 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, SetPrepopulatedAndParse);
117 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseParameterKnown); 121 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseParameterKnown);
118 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseParameterUnknown); 122 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseParameterUnknown);
119 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLEmpty); 123 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLEmpty);
120 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNoTemplateEnd); 124 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNoTemplateEnd);
121 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNoKnownParameters); 125 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNoKnownParameters);
122 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLTwoParameters); 126 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLTwoParameters);
123 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNestedParameter); 127 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNestedParameter);
124 128
125 // Enumeration of the known types. 129 // Enumeration of the known types.
126 enum ReplacementType { 130 enum ReplacementType {
127 ENCODING, 131 ENCODING,
128 GOOGLE_ACCEPTED_SUGGESTION, 132 GOOGLE_ACCEPTED_SUGGESTION,
133 GOOGLE_ASSISTED_QUERY_STATS,
129 GOOGLE_BASE_URL, 134 GOOGLE_BASE_URL,
130 GOOGLE_BASE_SUGGEST_URL, 135 GOOGLE_BASE_SUGGEST_URL,
131 GOOGLE_INSTANT_ENABLED, 136 GOOGLE_INSTANT_ENABLED,
132 GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION, 137 GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION,
133 GOOGLE_RLZ, 138 GOOGLE_RLZ,
134 GOOGLE_SEARCH_FIELDTRIAL_GROUP, 139 GOOGLE_SEARCH_FIELDTRIAL_GROUP,
135 GOOGLE_UNESCAPED_SEARCH_TERMS, 140 GOOGLE_UNESCAPED_SEARCH_TERMS,
136 LANGUAGE, 141 LANGUAGE,
137 SEARCH_TERMS, 142 SEARCH_TERMS,
138 }; 143 };
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 TemplateURLRef url_ref_; 429 TemplateURLRef url_ref_;
425 TemplateURLRef suggestions_url_ref_; 430 TemplateURLRef suggestions_url_ref_;
426 TemplateURLRef instant_url_ref_; 431 TemplateURLRef instant_url_ref_;
427 432
428 // TODO(sky): Add date last parsed OSD file. 433 // TODO(sky): Add date last parsed OSD file.
429 434
430 DISALLOW_COPY_AND_ASSIGN(TemplateURL); 435 DISALLOW_COPY_AND_ASSIGN(TemplateURL);
431 }; 436 };
432 437
433 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ 438 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698