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

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

Issue 2198143002: Componentize spellcheck [3]: move renderer/ files to component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_SPELLCHECKER_CUSTOM_DICTIONARY_ENGINE_H_
6 #define CHROME_RENDERER_SPELLCHECKER_CUSTOM_DICTIONARY_ENGINE_H_
7
8 #include <set>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "base/strings/string16.h"
13
14 // Custom spellcheck dictionary. Words in this dictionary are always correctly
15 // spelled. Words that are not in this dictionary may or may not be correctly
16 // spelled.
17 class CustomDictionaryEngine {
18 public:
19 CustomDictionaryEngine();
20 ~CustomDictionaryEngine();
21
22 // Initialize the custom dictionary engine.
23 void Init(const std::set<std::string>& words);
24
25 // Spellcheck |text|. Assumes that another spelling engine has set
26 // |misspelling_start| and |misspelling_len| to indicate a misspelling.
27 // Returns true if there are no misspellings, otherwise returns false.
28 bool SpellCheckWord(const base::string16& text,
29 int misspelling_start,
30 int misspelling_len);
31
32 // Update custom dictionary words.
33 void OnCustomDictionaryChanged(const std::set<std::string>& words_added,
34 const std::set<std::string>& words_removed);
35
36 private:
37 // Correctly spelled words.
38 std::set<base::string16> dictionary_;
39
40 DISALLOW_COPY_AND_ASSIGN(CustomDictionaryEngine);
41 };
42
43 #endif // CHROME_RENDERER_SPELLCHECKER_CUSTOM_DICTIONARY_ENGINE_H_
OLDNEW
« no previous file with comments | « chrome/renderer/spellchecker/OWNERS ('k') | chrome/renderer/spellchecker/custom_dictionary_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698