| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_CHROMEOS_DRIVE_SEARCH_METADATA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_SEARCH_METADATA_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SEARCH_METADATA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SEARCH_METADATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // be the same one as |resource_metadata| uses. | 25 // be the same one as |resource_metadata| uses. |
| 26 void SearchMetadata( | 26 void SearchMetadata( |
| 27 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner, | 27 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner, |
| 28 ResourceMetadata* resource_metadata, | 28 ResourceMetadata* resource_metadata, |
| 29 FileCache* cache, | 29 FileCache* cache, |
| 30 const std::string& query, | 30 const std::string& query, |
| 31 int search_options, | 31 int search_options, |
| 32 int at_most_num_matches, | 32 int at_most_num_matches, |
| 33 const SearchMetadataCallback& callback); | 33 const SearchMetadataCallback& callback); |
| 34 | 34 |
| 35 // Finds |query| in |text| while ignoring case. Returns true if |query| is | 35 // Finds |query| in |text| while ignoring cases or accents. Cases of non-ASCII |
| 36 // found. Returns false if |query| is not found, or empty. |highlighted_text| | 36 // characters are also ignored; they are compared in the 'Primary Level' of |
| 37 // will have the original text with matched portions highlighted with <b> tag | 37 // http://userguide.icu-project.org/collation/concepts. |
| 38 // (multiple portions can be highlighted). Meta characters are escaped like | 38 // Returns true if |query| is found. |highlighted_text| will have the original |
| 39 // <. The original contents of |highlighted| will be lost. | 39 // text with matched portions highlighted with <b> tag (only the first match |
| 40 // is highlighted). Meta characters are escaped like <. The original |
| 41 // contents of |highlighted| will be lost. |
| 40 bool FindAndHighlight(const std::string& text, | 42 bool FindAndHighlight(const std::string& text, |
| 41 const std::string& query, | 43 const std::string& query, |
| 42 std::string* highlighted_text); | 44 std::string* highlighted_text); |
| 43 | 45 |
| 44 } // namespace internal | 46 } // namespace internal |
| 45 } // namespace drive | 47 } // namespace drive |
| 46 | 48 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SEARCH_METADATA_H_ | 49 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SEARCH_METADATA_H_ |
| OLD | NEW |