| 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) OVERRIDE; | 27 virtual bool OnMessageReceived(const IPC::Message& message) override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 friend class TestingSpellCheckMessageFilter; | 30 friend class TestingSpellCheckMessageFilter; |
| 31 | 31 |
| 32 virtual ~SpellCheckMessageFilter(); | 32 virtual ~SpellCheckMessageFilter(); |
| 33 | 33 |
| 34 void OnSpellCheckerRequestDictionary(); | 34 void OnSpellCheckerRequestDictionary(); |
| 35 void OnNotifyChecked(const base::string16& word, bool misspelled); | 35 void OnNotifyChecked(const base::string16& word, bool misspelled); |
| 36 void OnRespondDocumentMarkers(const std::vector<uint32>& markers); | 36 void OnRespondDocumentMarkers(const std::vector<uint32>& markers); |
| 37 #if !defined(OS_MACOSX) | 37 #if !defined(OS_MACOSX) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 66 // Can be overridden for testing. | 66 // Can be overridden for testing. |
| 67 virtual SpellcheckService* GetSpellcheckService() const; | 67 virtual SpellcheckService* GetSpellcheckService() const; |
| 68 | 68 |
| 69 int render_process_id_; | 69 int render_process_id_; |
| 70 | 70 |
| 71 // 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. |
| 72 scoped_ptr<SpellingServiceClient> client_; | 72 scoped_ptr<SpellingServiceClient> client_; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ | 75 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ |
| OLD | NEW |