| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_TOKENIZED_STRING_CHAR_ITERATOR_H_ | 5 #ifndef UI_APP_LIST_SEARCH_TOKENIZED_STRING_CHAR_ITERATOR_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_TOKENIZED_STRING_CHAR_ITERATOR_H_ | 6 #define UI_APP_LIST_SEARCH_TOKENIZED_STRING_CHAR_ITERATOR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/ui/app_list/search/tokenized_string.h" | 10 #include "ui/app_list/app_list_export.h" |
| 11 #include "ui/app_list/search/tokenized_string.h" |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 namespace i18n { | 14 namespace i18n { |
| 14 class UTF16CharIterator; | 15 class UTF16CharIterator; |
| 15 } | 16 } |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace app_list { | 19 namespace app_list { |
| 19 | 20 |
| 20 // An UTF16 char iterator for a TokenizedString. | 21 // An UTF16 char iterator for a TokenizedString. |
| 21 class TokenizedStringCharIterator { | 22 class APP_LIST_EXPORT TokenizedStringCharIterator { |
| 22 public: | 23 public: |
| 23 struct State { | 24 struct State { |
| 24 State(); | 25 State(); |
| 25 State(size_t token_index, int char_index); | 26 State(size_t token_index, int char_index); |
| 26 | 27 |
| 27 size_t token_index; | 28 size_t token_index; |
| 28 int32 char_index; | 29 int32 char_index; |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 // Requires |tokenized| out-lives this iterator. | 32 // Requires |tokenized| out-lives this iterator. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 const TokenizedString::Mappings& mappings_; | 67 const TokenizedString::Mappings& mappings_; |
| 67 | 68 |
| 68 size_t current_token_; | 69 size_t current_token_; |
| 69 scoped_ptr<base::i18n::UTF16CharIterator> current_token_iter_; | 70 scoped_ptr<base::i18n::UTF16CharIterator> current_token_iter_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(TokenizedStringCharIterator); | 72 DISALLOW_COPY_AND_ASSIGN(TokenizedStringCharIterator); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace app_list | 75 } // namespace app_list |
| 75 | 76 |
| 76 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_TOKENIZED_STRING_CHAR_ITERATOR_H_ | 77 #endif // UI_APP_LIST_SEARCH_TOKENIZED_STRING_CHAR_ITERATOR_H_ |
| OLD | NEW |