OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_SPELLCHECK_MESSAGE_FILTER_H_ | 5 #ifndef CHROME_BROWSER_SPELLCHECK_MESSAGE_FILTER_H_ |
6 #define CHROME_BROWSER_SPELLCHECK_MESSAGE_FILTER_H_ | 6 #define CHROME_BROWSER_SPELLCHECK_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include "content/browser/browser_message_filter.h" | 8 #include "content/browser/browser_message_filter.h" |
9 | 9 |
10 // A message filter implementation that receives | 10 // A message filter implementation that receives |
11 // the platform spell checker requests from SpellCheckProvider. | 11 // the platform spell checker requests from SpellCheckProvider. |
12 class SpellCheckMessageFilter : public BrowserMessageFilter { | 12 class SpellCheckMessageFilter : public BrowserMessageFilter { |
13 public: | 13 public: |
14 explicit SpellCheckMessageFilter(int render_process_id); | 14 explicit SpellCheckMessageFilter(int render_process_id); |
15 ~SpellCheckMessageFilter(); | 15 virtual ~SpellCheckMessageFilter(); |
16 | 16 |
17 // BrowserMessageFilter implementation. | 17 // BrowserMessageFilter implementation. |
18 virtual void OverrideThreadForMessage(const IPC::Message& message, | 18 virtual void OverrideThreadForMessage(const IPC::Message& message, |
19 BrowserThread::ID* thread); | 19 BrowserThread::ID* thread); |
20 virtual bool OnMessageReceived(const IPC::Message& message, | 20 virtual bool OnMessageReceived(const IPC::Message& message, |
21 bool* message_was_ok); | 21 bool* message_was_ok); |
22 | 22 |
23 private: | 23 private: |
24 void OnPlatformCheckSpelling(const string16& word, int tag, bool* correct); | 24 void OnPlatformCheckSpelling(const string16& word, int tag, bool* correct); |
25 void OnPlatformFillSuggestionList(const string16& word, | 25 void OnPlatformFillSuggestionList(const string16& word, |
26 std::vector<string16>* suggestions); | 26 std::vector<string16>* suggestions); |
27 void OnGetDocumentTag(int* tag); | 27 void OnGetDocumentTag(int* tag); |
28 void OnDocumentWithTagClosed(int tag); | 28 void OnDocumentWithTagClosed(int tag); |
29 void OnShowSpellingPanel(bool show); | 29 void OnShowSpellingPanel(bool show); |
30 void OnUpdateSpellingPanelWithMisspelledWord(const string16& word); | 30 void OnUpdateSpellingPanelWithMisspelledWord(const string16& word); |
31 void OnPlatformRequestTextCheck(int route_id, | 31 void OnPlatformRequestTextCheck(int route_id, |
32 int identifier, | 32 int identifier, |
33 int document_tag, | 33 int document_tag, |
34 const string16& text); | 34 const string16& text); |
35 void OnSpellCheckerRequestDictionary(); | 35 void OnSpellCheckerRequestDictionary(); |
36 void OnNotifyChecked(bool misspelled); | 36 void OnNotifyChecked(bool misspelled); |
37 | 37 |
38 int render_process_id_; | 38 int render_process_id_; |
39 }; | 39 }; |
40 | 40 |
41 #endif // CHROME_BROWSER_SPELLCHECK_MESSAGE_FILTER_H_ | 41 #endif // CHROME_BROWSER_SPELLCHECK_MESSAGE_FILTER_H_ |
OLD | NEW |