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

Side by Side Diff: chrome/renderer/spellchecker/custom_dictionary_engine.cc

Issue 105493002: Use base namespace for string16 in chrome/renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/spellchecker/custom_dictionary_engine.h" 5 #include "chrome/renderer/spellchecker/custom_dictionary_engine.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 9
10 CustomDictionaryEngine::CustomDictionaryEngine() { 10 CustomDictionaryEngine::CustomDictionaryEngine() {
(...skipping 23 matching lines...) Expand all
34 dictionary_.insert(UTF8ToUTF16(*it)); 34 dictionary_.insert(UTF8ToUTF16(*it));
35 } 35 }
36 for (std::vector<std::string>::const_iterator it = words_removed.begin(); 36 for (std::vector<std::string>::const_iterator it = words_removed.begin();
37 it != words_removed.end(); 37 it != words_removed.end();
38 ++it) { 38 ++it) {
39 dictionary_.erase(UTF8ToUTF16(*it)); 39 dictionary_.erase(UTF8ToUTF16(*it));
40 } 40 }
41 } 41 }
42 42
43 bool CustomDictionaryEngine::SpellCheckWord( 43 bool CustomDictionaryEngine::SpellCheckWord(
44 const string16& text, 44 const base::string16& text,
45 int misspelling_start, 45 int misspelling_start,
46 int misspelling_len) { 46 int misspelling_len) {
47 // The text to be checked is empty on OSX(async) right now. 47 // The text to be checked is empty on OSX(async) right now.
48 // TODO(groby): Fix as part of async hook-up. (http://crbug.com/178241) 48 // TODO(groby): Fix as part of async hook-up. (http://crbug.com/178241)
49 return 49 return
50 misspelling_start >= 0 && 50 misspelling_start >= 0 &&
51 misspelling_len > 0 && 51 misspelling_len > 0 &&
52 size_t(misspelling_start + misspelling_len) <= text.length() && 52 size_t(misspelling_start + misspelling_len) <= text.length() &&
53 dictionary_.count(text.substr(misspelling_start, misspelling_len)) > 0; 53 dictionary_.count(text.substr(misspelling_start, misspelling_len)) > 0;
54 } 54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698