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

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

Issue 24012002: Move Range code to gfx. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: d Created 7 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 | Annotate | Revision Log
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 "chrome/browser/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 "chrome/browser/ui/app_list/search/term_break_iterator.h"
(...skipping 15 matching lines...) Expand all
26 26
27 while (break_iter.Advance()) { 27 while (break_iter.Advance()) {
28 if (!break_iter.IsWord()) 28 if (!break_iter.IsWord())
29 continue; 29 continue;
30 30
31 const string16 word(break_iter.GetString()); 31 const string16 word(break_iter.GetString());
32 const size_t word_start = break_iter.prev(); 32 const size_t word_start = break_iter.prev();
33 TermBreakIterator term_iter(word); 33 TermBreakIterator term_iter(word);
34 while (term_iter.Advance()) { 34 while (term_iter.Advance()) {
35 tokens_.push_back(base::i18n::ToLower(term_iter.GetCurrentTerm())); 35 tokens_.push_back(base::i18n::ToLower(term_iter.GetCurrentTerm()));
36 mappings_.push_back(ui::Range(word_start + term_iter.prev(), 36 mappings_.push_back(gfx::Range(word_start + term_iter.prev(),
37 word_start + term_iter.pos())); 37 word_start + term_iter.pos()));
38 } 38 }
39 } 39 }
40 } 40 }
41 41
42 } // namespace app_list 42 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/search/tokenized_string.h ('k') | chrome/browser/ui/app_list/search/tokenized_string_match.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698