| 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 |
| 205 // Generates a subset of the given surrounding_text string, for Icing | 211 // Generates a subset of the given surrounding_text string, for Icing |
| 206 // integration. | 212 // integration. |
| 207 // |surrounding_text| the entire text context that contains the selection. | 213 // |surrounding_text| the entire text context that contains the selection. |
| 208 // |padding_each_side| the number of characters of padding desired on each | 214 // |padding_each_side| the number of characters of padding desired on each |
| 209 // side of the selection (negative values treated as 0). | 215 // side of the selection (negative values treated as 0). |
| 210 // |start| the start offset of the selection, updated to reflect the new | 216 // |start| the start offset of the selection, updated to reflect the new |
| 211 // position | 217 // position |
| 212 // of the selection in the function result. | 218 // of the selection in the function result. |
| 213 // |end| the end offset of the selection, updated to reflect the new position | 219 // |end| the end offset of the selection, updated to reflect the new position |
| 214 // of the selection in the function result. | 220 // of the selection in the function result. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 240 // The callback for notifications of Icing selection being available. | 246 // The callback for notifications of Icing selection being available. |
| 241 IcingCallback icing_callback_; | 247 IcingCallback icing_callback_; |
| 242 | 248 |
| 243 // Used to hold the context until an upcoming search term request is started. | 249 // Used to hold the context until an upcoming search term request is started. |
| 244 std::unique_ptr<ContextualSearchContext> context_; | 250 std::unique_ptr<ContextualSearchContext> context_; |
| 245 | 251 |
| 246 DISALLOW_COPY_AND_ASSIGN(ContextualSearchDelegate); | 252 DISALLOW_COPY_AND_ASSIGN(ContextualSearchDelegate); |
| 247 }; | 253 }; |
| 248 | 254 |
| 249 #endif // CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_DELEGATE_H_ | 255 #endif // CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_DELEGATE_H_ |
| OLD | NEW |