OLD | NEW |
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 "cocoa_spelling_engine_mac.h" | 5 #include "cocoa_spelling_engine_mac.h" |
6 | 6 |
7 #include "chrome/common/spellcheck_messages.h" | 7 #include "chrome/common/spellcheck_messages.h" |
8 #include "content/public/renderer/render_thread.h" | 8 #include "content/public/renderer/render_thread.h" |
9 | 9 |
10 using content::RenderThread; | 10 using content::RenderThread; |
11 | 11 |
12 SpellingEngine* CreateNativeSpellingEngine() { | 12 SpellingEngine* CreateNativeSpellingEngine() { |
13 return new CocoaSpellingEngine(); | 13 return new CocoaSpellingEngine(); |
14 } | 14 } |
15 | 15 |
| 16 void CocoaSpellingEngine::Init(base::PlatformFile bdict_file, |
| 17 const std::vector<std::string>&) { |
| 18 DCHECK(bdict_file == base::kInvalidPlatformFileValue); |
| 19 } |
| 20 |
16 bool CocoaSpellingEngine::InitializeIfNeeded() { | 21 bool CocoaSpellingEngine::InitializeIfNeeded() { |
17 return false; // We never need to initialize. | 22 return false; // We never need to initialize. |
18 } | 23 } |
19 | 24 |
20 bool CocoaSpellingEngine::IsEnabled() { | 25 bool CocoaSpellingEngine::IsEnabled() { |
21 return true; // OSX is always enabled. | 26 return true; // OSX is always enabled. |
22 } | 27 } |
23 | 28 |
24 // Synchronously query against CocoaSpellinger. | 29 // Synchronously query against CocoaSpellinger. |
25 // TODO(groby): We might want async support here, too. Ideally, | 30 // TODO(groby): We might want async support here, too. Ideally, |
(...skipping 12 matching lines...) Expand all Loading... |
38 void CocoaSpellingEngine::FillSuggestionList( | 43 void CocoaSpellingEngine::FillSuggestionList( |
39 const string16& wrong_word, | 44 const string16& wrong_word, |
40 std::vector<string16>* optional_suggestions) { | 45 std::vector<string16>* optional_suggestions) { |
41 RenderThread::Get()->Send(new SpellCheckHostMsg_FillSuggestionList( | 46 RenderThread::Get()->Send(new SpellCheckHostMsg_FillSuggestionList( |
42 wrong_word, optional_suggestions)); | 47 wrong_word, optional_suggestions)); |
43 } | 48 } |
44 | 49 |
45 void CocoaSpellingEngine::OnWordAdded(const std::string&) { | 50 void CocoaSpellingEngine::OnWordAdded(const std::string&) { |
46 // OSX doesn't support the custom dictionary. | 51 // OSX doesn't support the custom dictionary. |
47 } | 52 } |
OLD | NEW |