OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_DELEGATE_H_ |
6 #define CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_DELEGATE_H_ | 6 #define CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_DELEGATE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 std::string* context_language, | 195 std::string* context_language, |
196 std::string* thumbnail_url, | 196 std::string* thumbnail_url, |
197 std::string* caption); | 197 std::string* caption); |
198 | 198 |
199 // Extracts the start and end location from a mentions list, and sets the | 199 // Extracts the start and end location from a mentions list, and sets the |
200 // integers referenced by |startResult| and |endResult|. | 200 // integers referenced by |startResult| and |endResult|. |
201 void ExtractMentionsStartEnd(const base::ListValue& mentions_list, | 201 void ExtractMentionsStartEnd(const base::ListValue& mentions_list, |
202 int* startResult, | 202 int* startResult, |
203 int* endResult); | 203 int* endResult); |
204 | 204 |
205 // Decodes the Contextual Cards (Now on Tap) response from the given | |
206 // dictionary, and sets the subtitle and/or thumbnail if they are present. | |
207 void DecodeContextualCardsResponse(const base::DictionaryValue& dict, | |
208 std::string* subtitle, | |
209 std::string* thumbnail); | |
210 | |
211 // Generates a subset of the given surrounding_text string, for Icing | 205 // Generates a subset of the given surrounding_text string, for Icing |
212 // integration. | 206 // integration. |
213 // |surrounding_text| the entire text context that contains the selection. | 207 // |surrounding_text| the entire text context that contains the selection. |
214 // |padding_each_side| the number of characters of padding desired on each | 208 // |padding_each_side| the number of characters of padding desired on each |
215 // side of the selection (negative values treated as 0). | 209 // side of the selection (negative values treated as 0). |
216 // |start| the start offset of the selection, updated to reflect the new | 210 // |start| the start offset of the selection, updated to reflect the new |
217 // position | 211 // position |
218 // of the selection in the function result. | 212 // of the selection in the function result. |
219 // |end| the end offset of the selection, updated to reflect the new position | 213 // |end| the end offset of the selection, updated to reflect the new position |
220 // of the selection in the function result. | 214 // of the selection in the function result. |
(...skipping 25 matching lines...) Expand all Loading... |
246 // The callback for notifications of Icing selection being available. | 240 // The callback for notifications of Icing selection being available. |
247 IcingCallback icing_callback_; | 241 IcingCallback icing_callback_; |
248 | 242 |
249 // Used to hold the context until an upcoming search term request is started. | 243 // Used to hold the context until an upcoming search term request is started. |
250 std::unique_ptr<ContextualSearchContext> context_; | 244 std::unique_ptr<ContextualSearchContext> context_; |
251 | 245 |
252 DISALLOW_COPY_AND_ASSIGN(ContextualSearchDelegate); | 246 DISALLOW_COPY_AND_ASSIGN(ContextualSearchDelegate); |
253 }; | 247 }; |
254 | 248 |
255 #endif // CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_DELEGATE_H_ | 249 #endif // CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_DELEGATE_H_ |
OLD | NEW |