Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 | 74 |
| 75 struct ContextualSearchParams { | 75 struct ContextualSearchParams { |
| 76 ContextualSearchParams(); | 76 ContextualSearchParams(); |
| 77 ContextualSearchParams(const int version, | 77 ContextualSearchParams(const int version, |
| 78 const size_t start, | 78 const size_t start, |
| 79 const size_t end, | 79 const size_t end, |
| 80 const std::string& selection, | 80 const std::string& selection, |
| 81 const std::string& content, | 81 const std::string& content, |
| 82 const std::string& base_page_url, | 82 const std::string& base_page_url, |
| 83 const std::string& encoding); | 83 const std::string& encoding); |
| 84 ContextualSearchParams(const int version, | |
| 85 const size_t start, | |
| 86 const size_t end, | |
| 87 const std::string& selection, | |
| 88 const std::string& content, | |
| 89 const std::string& base_page_url, | |
| 90 const std::string& encoding, | |
| 91 const bool resolve); | |
| 84 ~ContextualSearchParams(); | 92 ~ContextualSearchParams(); |
| 85 | 93 |
| 86 // The version of contextual search. | 94 // The version of contextual search. |
| 87 int version; | 95 int version; |
| 88 | 96 |
| 89 // Offset into the page content of the start of the user selection. | 97 // Offset into the page content of the start of the user selection. |
| 90 size_t start; | 98 size_t start; |
| 91 | 99 |
| 92 // Offset into the page content of the end of the user selection. | 100 // Offset into the page content of the end of the user selection. |
| 93 size_t end; | 101 size_t end; |
| 94 | 102 |
| 95 // The user selection. | 103 // The user selection. |
| 96 std::string selection; | 104 std::string selection; |
| 97 | 105 |
| 98 // The text including and surrounding the user selection. | 106 // The text including and surrounding the user selection. |
| 99 std::string content; | 107 std::string content; |
| 100 | 108 |
| 101 // The URL of the page containing the user selection. | 109 // The URL of the page containing the user selection. |
| 102 std::string base_page_url; | 110 std::string base_page_url; |
| 103 | 111 |
| 104 // The encoding of content. | 112 // The encoding of content. |
| 105 std::string encoding; | 113 std::string encoding; |
| 114 | |
| 115 // True to have the server generate a search term based on the user | |
| 116 // selection and surrounding content. False to simply return the user | |
| 117 // selection as the search term. | |
| 118 bool resolve; | |
|
Peter Kasting
2014/07/31 20:33:49
Cool, this is much more comprehensible now.
This
jeremycho
2014/07/31 21:08:39
Done.
| |
| 106 }; | 119 }; |
| 107 | 120 |
| 108 // The search terms (query). | 121 // The search terms (query). |
| 109 base::string16 search_terms; | 122 base::string16 search_terms; |
| 110 | 123 |
| 111 // The original (input) query. | 124 // The original (input) query. |
| 112 base::string16 original_query; | 125 base::string16 original_query; |
| 113 | 126 |
| 114 // The type the original input query was identified as. | 127 // The type the original input query was identified as. |
| 115 metrics::OmniboxInputType::Type input_type; | 128 metrics::OmniboxInputType::Type input_type; |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 704 TemplateURLRef new_tab_url_ref_; | 717 TemplateURLRef new_tab_url_ref_; |
| 705 TemplateURLRef contextual_search_url_ref_; | 718 TemplateURLRef contextual_search_url_ref_; |
| 706 scoped_ptr<AssociatedExtensionInfo> extension_info_; | 719 scoped_ptr<AssociatedExtensionInfo> extension_info_; |
| 707 | 720 |
| 708 // TODO(sky): Add date last parsed OSD file. | 721 // TODO(sky): Add date last parsed OSD file. |
| 709 | 722 |
| 710 DISALLOW_COPY_AND_ASSIGN(TemplateURL); | 723 DISALLOW_COPY_AND_ASSIGN(TemplateURL); |
| 711 }; | 724 }; |
| 712 | 725 |
| 713 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ | 726 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ |
| OLD | NEW |