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

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

Issue 15940004: Add HasWord(string) method to SpellcheckCustomDictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Clarified message direction (browser-to-renderer) in spellcheck_messages.h Created 7 years, 6 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 #ifndef CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ 5 #ifndef CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_
6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ 6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 27 matching lines...) Expand all
38 enum ResultFilter { 38 enum ResultFilter {
39 DO_NOT_MODIFY = 1, // Do not modify results. 39 DO_NOT_MODIFY = 1, // Do not modify results.
40 USE_NATIVE_CHECKER, // Use native checker to double-check. 40 USE_NATIVE_CHECKER, // Use native checker to double-check.
41 }; 41 };
42 42
43 SpellCheck(); 43 SpellCheck();
44 virtual ~SpellCheck(); 44 virtual ~SpellCheck();
45 45
46 // TODO: Try to move that all to SpellcheckLanguage. 46 // TODO: Try to move that all to SpellcheckLanguage.
47 void Init(base::PlatformFile file, 47 void Init(base::PlatformFile file,
48 const std::vector<std::string>& custom_words, 48 const std::set<std::string>& custom_words,
49 const std::string& language); 49 const std::string& language);
50 50
51 // If there is no dictionary file, then this requests one from the browser 51 // If there is no dictionary file, then this requests one from the browser
52 // and does not block. In this case it returns true. 52 // and does not block. In this case it returns true.
53 // If there is a dictionary file, but Hunspell has not been loaded, then 53 // If there is a dictionary file, but Hunspell has not been loaded, then
54 // this loads Hunspell. 54 // this loads Hunspell.
55 // If Hunspell is already loaded, this does nothing. In both the latter cases 55 // If Hunspell is already loaded, this does nothing. In both the latter cases
56 // it returns false, meaning that it is OK to continue spellchecking. 56 // it returns false, meaning that it is OK to continue spellchecking.
57 bool InitializeIfNeeded(); 57 bool InitializeIfNeeded();
58 58
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 friend class SpellCheckTest; 112 friend class SpellCheckTest;
113 FRIEND_TEST_ALL_PREFIXES(SpellCheckTest, GetAutoCorrectionWord_EN_US); 113 FRIEND_TEST_ALL_PREFIXES(SpellCheckTest, GetAutoCorrectionWord_EN_US);
114 FRIEND_TEST_ALL_PREFIXES(SpellCheckTest, 114 FRIEND_TEST_ALL_PREFIXES(SpellCheckTest,
115 RequestSpellCheckMultipleTimesWithoutInitialization); 115 RequestSpellCheckMultipleTimesWithoutInitialization);
116 116
117 // RenderProcessObserver implementation: 117 // RenderProcessObserver implementation:
118 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; 118 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
119 119
120 // Message handlers. 120 // Message handlers.
121 void OnInit(IPC::PlatformFileForTransit bdict_file, 121 void OnInit(IPC::PlatformFileForTransit bdict_file,
122 const std::vector<std::string>& custom_words, 122 const std::set<std::string>& custom_words,
123 const std::string& language, 123 const std::string& language,
124 bool auto_spell_correct); 124 bool auto_spell_correct);
125 void OnCustomDictionaryChanged( 125 void OnCustomDictionaryChanged(
126 const std::vector<std::string>& words_added, 126 const std::vector<std::string>& words_added,
127 const std::vector<std::string>& words_removed); 127 const std::vector<std::string>& words_removed);
128 void OnEnableAutoSpellCorrect(bool enable); 128 void OnEnableAutoSpellCorrect(bool enable);
129 void OnEnableSpellCheck(bool enable); 129 void OnEnableSpellCheck(bool enable);
130 void OnRequestDocumentMarkers(); 130 void OnRequestDocumentMarkers();
131 131
132 #if !defined (OS_MACOSX) 132 #if !defined (OS_MACOSX)
(...skipping 20 matching lines...) Expand all
153 // Remember state for auto spell correct. 153 // Remember state for auto spell correct.
154 bool auto_spell_correct_turned_on_; 154 bool auto_spell_correct_turned_on_;
155 155
156 // Remember state for spellchecking. 156 // Remember state for spellchecking.
157 bool spellcheck_enabled_; 157 bool spellcheck_enabled_;
158 158
159 DISALLOW_COPY_AND_ASSIGN(SpellCheck); 159 DISALLOW_COPY_AND_ASSIGN(SpellCheck);
160 }; 160 };
161 161
162 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ 162 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_
OLDNEW
« no previous file with comments | « chrome/renderer/spellchecker/custom_dictionary_engine_unittest.cc ('k') | chrome/renderer/spellchecker/spellcheck.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698