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

Unified Diff: chrome/browser/history/query_parser.cc

Issue 5796003: Refactor WordIterator into base::BreakIterator.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/in_memory_url_index.cc ('k') | views/view_text_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/query_parser.cc
===================================================================
--- chrome/browser/history/query_parser.cc (revision 69162)
+++ chrome/browser/history/query_parser.cc (working copy)
@@ -7,7 +7,7 @@
#include <algorithm>
#include "app/l10n_util.h"
-#include "base/i18n/word_iterator.h"
+#include "base/i18n/break_iterator.h"
#include "base/logging.h"
#include "base/scoped_vector.h"
#include "base/string_util.h"
@@ -322,7 +322,7 @@
bool QueryParser::ParseQueryImpl(const string16& query,
QueryNodeList* root) {
- WordIterator iter(&query, WordIterator::BREAK_WORD);
+ base::BreakIterator iter(&query, base::BreakIterator::BREAK_WORD);
// TODO(evanm): support a locale here
if (!iter.Init())
return false;
@@ -338,7 +338,7 @@
// is not necessarily a word, but could also be a sequence of punctuation
// or whitespace.
if (iter.IsWord()) {
- string16 word = iter.GetWord();
+ string16 word = iter.GetString();
QueryNodeWord* word_node = new QueryNodeWord(word);
if (in_quotes)
@@ -365,7 +365,7 @@
void QueryParser::ExtractQueryWords(const string16& text,
std::vector<QueryWord>* words) {
- WordIterator iter(&text, WordIterator::BREAK_WORD);
+ base::BreakIterator iter(&text, base::BreakIterator::BREAK_WORD);
// TODO(evanm): support a locale here
if (!iter.Init())
return;
@@ -375,7 +375,7 @@
// is not necessarily a word, but could also be a sequence of punctuation
// or whitespace.
if (iter.IsWord()) {
- string16 word = iter.GetWord();
+ string16 word = iter.GetString();
if (!word.empty()) {
words->push_back(QueryWord());
words->back().word = word;
« no previous file with comments | « chrome/browser/history/in_memory_url_index.cc ('k') | views/view_text_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698