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 <string> | 10 #include <string> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // the |post_data|(second part of the pair) which is encoded in | 66 // the |post_data|(second part of the pair) which is encoded in |
67 // "multipart/form-data" format, it also contains the MIME boundary used in | 67 // "multipart/form-data" format, it also contains the MIME boundary used in |
68 // the |post_data|. See http://tools.ietf.org/html/rfc2046 for the details. | 68 // the |post_data|. See http://tools.ietf.org/html/rfc2046 for the details. |
69 typedef std::pair<std::string, std::string> PostContent; | 69 typedef std::pair<std::string, std::string> PostContent; |
70 | 70 |
71 // This struct encapsulates arguments passed to | 71 // This struct encapsulates arguments passed to |
72 // TemplateURLRef::ReplaceSearchTerms methods. By default, only search_terms | 72 // TemplateURLRef::ReplaceSearchTerms methods. By default, only search_terms |
73 // is required and is passed in the constructor. | 73 // is required and is passed in the constructor. |
74 struct SearchTermsArgs { | 74 struct SearchTermsArgs { |
75 explicit SearchTermsArgs(const base::string16& search_terms); | 75 explicit SearchTermsArgs(const base::string16& search_terms); |
| 76 SearchTermsArgs(const SearchTermsArgs& other); |
76 ~SearchTermsArgs(); | 77 ~SearchTermsArgs(); |
77 | 78 |
78 struct ContextualSearchParams { | 79 struct ContextualSearchParams { |
79 ContextualSearchParams(); | 80 ContextualSearchParams(); |
80 // Used when the content is sent in the HTTP header instead of as CGI | 81 // Used when the content is sent in the HTTP header instead of as CGI |
81 // parameters. | 82 // parameters. |
82 // TODO(donnd): Remove base_page_url and selection parameters once | 83 // TODO(donnd): Remove base_page_url and selection parameters once |
83 // they are logged from the HTTP header. | 84 // they are logged from the HTTP header. |
84 ContextualSearchParams(const int version, | 85 ContextualSearchParams(const int version, |
85 const std::string& selection, | 86 const std::string& selection, |
86 const std::string& base_page_url, | 87 const std::string& base_page_url, |
87 const bool resolve); | 88 const bool resolve); |
88 // TODO(donnd): Delete constructor once Clank, iOS, and tests no | 89 // TODO(donnd): Delete constructor once Clank, iOS, and tests no |
89 // longer depend on it. | 90 // longer depend on it. |
90 ContextualSearchParams(const int version, | 91 ContextualSearchParams(const int version, |
91 const size_t start, | 92 const size_t start, |
92 const size_t end, | 93 const size_t end, |
93 const std::string& selection, | 94 const std::string& selection, |
94 const std::string& content, | 95 const std::string& content, |
95 const std::string& base_page_url, | 96 const std::string& base_page_url, |
96 const std::string& encoding, | 97 const std::string& encoding, |
97 const bool resolve); | 98 const bool resolve); |
| 99 ContextualSearchParams(const ContextualSearchParams& other); |
98 ~ContextualSearchParams(); | 100 ~ContextualSearchParams(); |
99 | 101 |
100 // The version of contextual search. | 102 // The version of contextual search. |
101 int version; | 103 int version; |
102 | 104 |
103 // Offset into the page content of the start of the user selection. | 105 // Offset into the page content of the start of the user selection. |
104 size_t start; | 106 size_t start; |
105 | 107 |
106 // Offset into the page content of the end of the user selection. | 108 // Offset into the page content of the end of the user selection. |
107 size_t end; | 109 size_t end; |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 TemplateURLRef new_tab_url_ref_; | 748 TemplateURLRef new_tab_url_ref_; |
747 TemplateURLRef contextual_search_url_ref_; | 749 TemplateURLRef contextual_search_url_ref_; |
748 scoped_ptr<AssociatedExtensionInfo> extension_info_; | 750 scoped_ptr<AssociatedExtensionInfo> extension_info_; |
749 | 751 |
750 // TODO(sky): Add date last parsed OSD file. | 752 // TODO(sky): Add date last parsed OSD file. |
751 | 753 |
752 DISALLOW_COPY_AND_ASSIGN(TemplateURL); | 754 DISALLOW_COPY_AND_ASSIGN(TemplateURL); |
753 }; | 755 }; |
754 | 756 |
755 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ | 757 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ |
OLD | NEW |