OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 explicit SearchTermsArgs(const base::string16& search_terms); | 76 explicit SearchTermsArgs(const base::string16& search_terms); |
77 SearchTermsArgs(const SearchTermsArgs& other); | 77 SearchTermsArgs(const SearchTermsArgs& other); |
78 ~SearchTermsArgs(); | 78 ~SearchTermsArgs(); |
79 | 79 |
80 struct ContextualSearchParams { | 80 struct ContextualSearchParams { |
81 ContextualSearchParams(); | 81 ContextualSearchParams(); |
82 // Used when the content is sent in the HTTP header instead of as CGI | 82 // Used when the content is sent in the HTTP header instead of as CGI |
83 // parameters. | 83 // parameters. |
84 // TODO(donnd): Remove base_page_url and selection parameters once | 84 // TODO(donnd): Remove base_page_url and selection parameters once |
85 // they are logged from the HTTP header. | 85 // they are logged from the HTTP header. |
86 ContextualSearchParams(const int version, | 86 ContextualSearchParams(int version, |
87 const std::string& selection, | 87 const std::string& selection, |
88 const std::string& base_page_url, | 88 const std::string& base_page_url, |
89 const bool resolve); | 89 int now_on_tap_version); |
90 // TODO(donnd): Delete constructor once Clank, iOS, and tests no | 90 // TODO(donnd): Delete constructor once Clank, iOS, and tests no |
91 // longer depend on it. | 91 // longer depend on it. |
92 ContextualSearchParams(const int version, | 92 ContextualSearchParams(int version, |
93 const size_t start, | 93 size_t start, |
94 const size_t end, | 94 size_t end, |
95 const std::string& selection, | 95 const std::string& selection, |
96 const std::string& content, | 96 const std::string& content, |
97 const std::string& base_page_url, | 97 const std::string& base_page_url, |
98 const std::string& encoding, | 98 const std::string& encoding, |
99 const bool resolve); | 99 int now_on_tap_version); |
100 ContextualSearchParams(const ContextualSearchParams& other); | 100 ContextualSearchParams(const ContextualSearchParams& other); |
101 ~ContextualSearchParams(); | 101 ~ContextualSearchParams(); |
102 | 102 |
103 // The version of contextual search. | 103 // The version of contextual search. |
104 int version; | 104 int version; |
105 | 105 |
106 // Offset into the page content of the start of the user selection. | 106 // Offset into the page content of the start of the user selection. |
107 size_t start; | 107 size_t start; |
108 | 108 |
109 // Offset into the page content of the end of the user selection. | 109 // Offset into the page content of the end of the user selection. |
110 size_t end; | 110 size_t end; |
111 | 111 |
112 // The user selection. | 112 // The user selection. |
113 std::string selection; | 113 std::string selection; |
114 | 114 |
115 // The text including and surrounding the user selection. | 115 // The text including and surrounding the user selection. |
116 std::string content; | 116 std::string content; |
117 | 117 |
118 // The URL of the page containing the user selection. | 118 // The URL of the page containing the user selection. |
119 std::string base_page_url; | 119 std::string base_page_url; |
120 | 120 |
121 // The encoding of content. | 121 // The encoding of content. |
122 std::string encoding; | 122 std::string encoding; |
123 | 123 |
124 // If true, the server will generate a search term based on the user | 124 // The version of Now on Tap data to request. |
125 // selection and context. Otherwise the user selection will be used as-is | 125 // A value of 0 indicates no data needed. |
126 // as the search term. | 126 int now_on_tap_version; |
127 bool resolve; | |
128 }; | 127 }; |
129 | 128 |
130 // The search terms (query). | 129 // The search terms (query). |
131 base::string16 search_terms; | 130 base::string16 search_terms; |
132 | 131 |
133 // The original (input) query. | 132 // The original (input) query. |
134 base::string16 original_query; | 133 base::string16 original_query; |
135 | 134 |
136 // The type the original input query was identified as. | 135 // The type the original input query was identified as. |
137 metrics::OmniboxInputType::Type input_type; | 136 metrics::OmniboxInputType::Type input_type; |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 | 756 |
758 // Caches the computed engine type across successive calls to GetEngineType(). | 757 // Caches the computed engine type across successive calls to GetEngineType(). |
759 mutable SearchEngineType engine_type_; | 758 mutable SearchEngineType engine_type_; |
760 | 759 |
761 // TODO(sky): Add date last parsed OSD file. | 760 // TODO(sky): Add date last parsed OSD file. |
762 | 761 |
763 DISALLOW_COPY_AND_ASSIGN(TemplateURL); | 762 DISALLOW_COPY_AND_ASSIGN(TemplateURL); |
764 }; | 763 }; |
765 | 764 |
766 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ | 765 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ |
OLD | NEW |