| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/spellchecker/word_trimmer.h" | 5 #include "components/spellcheck/browser/word_trimmer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/i18n/break_iterator.h" | 10 #include "base/i18n/break_iterator.h" |
| 11 | 11 |
| 12 base::string16 TrimWords(size_t* start, | 12 base::string16 TrimWords(size_t* start, |
| 13 size_t end, | 13 size_t end, |
| 14 const base::string16& text, | 14 const base::string16& text, |
| 15 size_t keep) { | 15 size_t keep) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 41 last = iter.pos(); | 41 last = iter.pos(); |
| 42 keep--; | 42 keep--; |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 if (first == std::string::npos) | 46 if (first == std::string::npos) |
| 47 return text; | 47 return text; |
| 48 *start -= first; | 48 *start -= first; |
| 49 return text.substr(first, last - first); | 49 return text.substr(first, last - first); |
| 50 } | 50 } |
| OLD | NEW |