| 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 void OverrideThreadForMessage(const IPC::Message& message, |
| 25 const IPC::Message& message, | 25 content::BrowserThread::ID* thread) override; |
| 26 content::BrowserThread::ID* thread) override; | 26 bool OnMessageReceived(const IPC::Message& message) override; |
| 27 virtual bool OnMessageReceived(const IPC::Message& message) override; | |
| 28 | 27 |
| 29 private: | 28 private: |
| 30 friend class TestingSpellCheckMessageFilter; | 29 friend class TestingSpellCheckMessageFilter; |
| 31 | 30 |
| 32 virtual ~SpellCheckMessageFilter(); | 31 ~SpellCheckMessageFilter() override; |
| 33 | 32 |
| 34 void OnSpellCheckerRequestDictionary(); | 33 void OnSpellCheckerRequestDictionary(); |
| 35 void OnNotifyChecked(const base::string16& word, bool misspelled); | 34 void OnNotifyChecked(const base::string16& word, bool misspelled); |
| 36 void OnRespondDocumentMarkers(const std::vector<uint32>& markers); | 35 void OnRespondDocumentMarkers(const std::vector<uint32>& markers); |
| 37 #if !defined(OS_MACOSX) | 36 #if !defined(OS_MACOSX) |
| 38 void OnCallSpellingService(int route_id, | 37 void OnCallSpellingService(int route_id, |
| 39 int identifier, | 38 int identifier, |
| 40 const base::string16& text, | 39 const base::string16& text, |
| 41 std::vector<SpellCheckMarker> markers); | 40 std::vector<SpellCheckMarker> markers); |
| 42 | 41 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 66 // Can be overridden for testing. | 65 // Can be overridden for testing. |
| 67 virtual SpellcheckService* GetSpellcheckService() const; | 66 virtual SpellcheckService* GetSpellcheckService() const; |
| 68 | 67 |
| 69 int render_process_id_; | 68 int render_process_id_; |
| 70 | 69 |
| 71 // A JSON-RPC client that calls the Spelling service in the background. | 70 // A JSON-RPC client that calls the Spelling service in the background. |
| 72 scoped_ptr<SpellingServiceClient> client_; | 71 scoped_ptr<SpellingServiceClient> client_; |
| 73 }; | 72 }; |
| 74 | 73 |
| 75 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ | 74 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ |
| OLD | NEW |