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

Side by Side Diff: ui/app_list/search/tokenized_string.cc

Issue 522683003: Move basic string operations to ui/app_list/search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/ui/app_list/search/tokenized_string.h" 5 #include "ui/app_list/search/tokenized_string.h"
6 6
7 #include "base/i18n/break_iterator.h" 7 #include "base/i18n/break_iterator.h"
8 #include "base/i18n/case_conversion.h" 8 #include "base/i18n/case_conversion.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/ui/app_list/search/term_break_iterator.h" 10 #include "ui/app_list/search/term_break_iterator.h"
11 11
12 using base::i18n::BreakIterator; 12 using base::i18n::BreakIterator;
13 13
14 namespace app_list { 14 namespace app_list {
15 15
16 TokenizedString::TokenizedString(const base::string16& text) 16 TokenizedString::TokenizedString(const base::string16& text)
17 : text_(text) { 17 : text_(text) {
18 Tokenize(); 18 Tokenize();
19 } 19 }
20 20
(...skipping 16 matching lines...) Expand all
37 TermBreakIterator term_iter(word); 37 TermBreakIterator term_iter(word);
38 while (term_iter.Advance()) { 38 while (term_iter.Advance()) {
39 tokens_.push_back(base::i18n::ToLower(term_iter.GetCurrentTerm())); 39 tokens_.push_back(base::i18n::ToLower(term_iter.GetCurrentTerm()));
40 mappings_.push_back(gfx::Range(word_start + term_iter.prev(), 40 mappings_.push_back(gfx::Range(word_start + term_iter.prev(),
41 word_start + term_iter.pos())); 41 word_start + term_iter.pos()));
42 } 42 }
43 } 43 }
44 } 44 }
45 45
46 } // namespace app_list 46 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/search/tokenized_string.h ('k') | ui/app_list/search/tokenized_string_char_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698