Chromium Code Reviews| 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 case. Returns true if |query| is |
|
satorux1
2013/05/27 05:00:24
please mention that non-ASCII characters are suppo
kinaba
2013/05/27 05:50:26
It does. Added a test.
| |
| 36 // found. Returns false if |query| is not found, or empty. |highlighted_text| | 36 // found. Returns false if |query| is not found, or empty. |highlighted_text| |
| 37 // will have the original text with matched portions highlighted with <b> tag | 37 // will have the original text with matched portions highlighted with <b> tag |
| 38 // (multiple portions can be highlighted). Meta characters are escaped like | 38 // (only the first match is highlighted). Meta characters are escaped like |
| 39 // <. The original contents of |highlighted| will be lost. | 39 // <. The original contents of |highlighted| will be lost. |
| 40 bool FindAndHighlight(const std::string& text, | 40 bool FindAndHighlight(const std::string& text, |
| 41 const std::string& query, | 41 const std::string& query, |
| 42 std::string* highlighted_text); | 42 std::string* highlighted_text); |
| 43 | 43 |
| 44 } // namespace internal | 44 } // namespace internal |
| 45 } // namespace drive | 45 } // namespace drive |
| 46 | 46 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SEARCH_METADATA_H_ | 47 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SEARCH_METADATA_H_ |
| OLD | NEW |