Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: components/spellcheck/browser/word_trimmer.cc

Issue 2244083002: Componentize spellcheck [4]: spellcheck/browser and android java-side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698