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

Side by Side Diff: components/spellcheck/renderer/custom_dictionary_engine.cc

Issue 2159283003: [WIP][DO NOT LAND] Componentize spellcheck Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 (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 "components/spellcheck/renderer/custom_dictionary_engine.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 10
11 CustomDictionaryEngine::CustomDictionaryEngine() { 11 CustomDictionaryEngine::CustomDictionaryEngine() {
12 } 12 }
13 13
14 CustomDictionaryEngine::~CustomDictionaryEngine() { 14 CustomDictionaryEngine::~CustomDictionaryEngine() {
15 } 15 }
(...skipping 24 matching lines...) Expand all
40 int misspelling_start, 40 int misspelling_start,
41 int misspelling_len) { 41 int misspelling_len) {
42 // The text to be checked is empty on OSX(async) right now. 42 // The text to be checked is empty on OSX(async) right now.
43 // TODO(groby): Fix as part of async hook-up. (http://crbug.com/178241) 43 // TODO(groby): Fix as part of async hook-up. (http://crbug.com/178241)
44 return 44 return
45 misspelling_start >= 0 && 45 misspelling_start >= 0 &&
46 misspelling_len > 0 && 46 misspelling_len > 0 &&
47 size_t(misspelling_start + misspelling_len) <= text.length() && 47 size_t(misspelling_start + misspelling_len) <= text.length() &&
48 dictionary_.count(text.substr(misspelling_start, misspelling_len)) > 0; 48 dictionary_.count(text.substr(misspelling_start, misspelling_len)) > 0;
49 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698