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 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ | 5 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ |
6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ | 6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/spellchecker/spelling_service_client.h" | 10 #include "chrome/browser/spellchecker/spelling_service_client.h" |
11 #include "content/public/browser/browser_message_filter.h" | 11 #include "content/public/browser/browser_message_filter.h" |
12 | 12 |
13 class SpellCheckMarker; | 13 class SpellCheckMarker; |
14 class SpellcheckService; | 14 class SpellcheckService; |
15 struct SpellCheckResult; | 15 struct SpellCheckResult; |
16 | 16 |
17 // A message filter implementation that receives spell checker requests from | 17 // A message filter implementation that receives spell checker requests from |
18 // SpellCheckProvider. | 18 // SpellCheckProvider. |
19 class SpellCheckMessageFilter : public content::BrowserMessageFilter { | 19 class SpellCheckMessageFilter : public content::BrowserMessageFilter { |
20 public: | 20 public: |
21 explicit SpellCheckMessageFilter(int render_process_id); | 21 explicit SpellCheckMessageFilter(int render_process_id); |
22 | 22 |
23 // content::BrowserMessageFilter implementation. | 23 // content::BrowserMessageFilter implementation. |
24 virtual void OverrideThreadForMessage( | 24 virtual void OverrideThreadForMessage( |
25 const IPC::Message& message, | 25 const IPC::Message& message, |
26 content::BrowserThread::ID* thread) OVERRIDE; | 26 content::BrowserThread::ID* thread) OVERRIDE; |
27 virtual bool OnMessageReceived(const IPC::Message& message, | 27 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
28 bool* message_was_ok) OVERRIDE; | |
29 | 28 |
30 private: | 29 private: |
31 friend class TestingSpellCheckMessageFilter; | 30 friend class TestingSpellCheckMessageFilter; |
32 | 31 |
33 virtual ~SpellCheckMessageFilter(); | 32 virtual ~SpellCheckMessageFilter(); |
34 | 33 |
35 void OnSpellCheckerRequestDictionary(); | 34 void OnSpellCheckerRequestDictionary(); |
36 void OnNotifyChecked(const base::string16& word, bool misspelled); | 35 void OnNotifyChecked(const base::string16& word, bool misspelled); |
37 void OnRespondDocumentMarkers(const std::vector<uint32>& markers); | 36 void OnRespondDocumentMarkers(const std::vector<uint32>& markers); |
38 #if !defined(OS_MACOSX) | 37 #if !defined(OS_MACOSX) |
(...skipping 28 matching lines...) Expand all Loading... |
67 // Can be overridden for testing. | 66 // Can be overridden for testing. |
68 virtual SpellcheckService* GetSpellcheckService() const; | 67 virtual SpellcheckService* GetSpellcheckService() const; |
69 | 68 |
70 int render_process_id_; | 69 int render_process_id_; |
71 | 70 |
72 // A JSON-RPC client that calls the Spelling service in the background. | 71 // A JSON-RPC client that calls the Spelling service in the background. |
73 scoped_ptr<SpellingServiceClient> client_; | 72 scoped_ptr<SpellingServiceClient> client_; |
74 }; | 73 }; |
75 | 74 |
76 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ | 75 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ |
OLD | NEW |