| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_ |
| 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "content/shell/renderer/test_runner/MockSpellCheck.h" | 9 #include "content/shell/renderer/test_runner/MockSpellCheck.h" |
| 10 #include "content/shell/renderer/test_runner/WebTask.h" | 10 #include "content/shell/renderer/test_runner/WebTask.h" |
| 11 #include "third_party/WebKit/public/web/WebSpellCheckClient.h" | 11 #include "third_party/WebKit/public/web/WebSpellCheckClient.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 |
| 15 class WebTestDelegate; |
| 14 class WebTestProxyBase; | 16 class WebTestProxyBase; |
| 15 } | |
| 16 | |
| 17 namespace WebTestRunner { | |
| 18 class WebTestDelegate; | |
| 19 } | |
| 20 | |
| 21 namespace content { | |
| 22 | 17 |
| 23 class SpellCheckClient : public blink::WebSpellCheckClient { | 18 class SpellCheckClient : public blink::WebSpellCheckClient { |
| 24 public: | 19 public: |
| 25 explicit SpellCheckClient(content::WebTestProxyBase*); | 20 explicit SpellCheckClient(WebTestProxyBase*); |
| 26 virtual ~SpellCheckClient(); | 21 virtual ~SpellCheckClient(); |
| 27 | 22 |
| 28 void setDelegate(WebTestRunner::WebTestDelegate*); | 23 void setDelegate(WebTestDelegate*); |
| 29 | 24 |
| 30 WebTestRunner::WebTaskList* taskList() { return &m_taskList; } | 25 WebTaskList* taskList() { return &m_taskList; } |
| 31 MockSpellCheck* mockSpellCheck() { return &m_spellcheck; } | 26 MockSpellCheck* mockSpellCheck() { return &m_spellcheck; } |
| 32 | 27 |
| 33 // blink::WebSpellCheckClient implementation. | 28 // blink::WebSpellCheckClient implementation. |
| 34 virtual void spellCheck(const blink::WebString&, int& offset, int& length, b
link::WebVector<blink::WebString>* optionalSuggestions); | 29 virtual void spellCheck(const blink::WebString&, int& offset, int& length, b
link::WebVector<blink::WebString>* optionalSuggestions); |
| 35 virtual void checkTextOfParagraph(const blink::WebString&, blink::WebTextChe
ckingTypeMask, blink::WebVector<blink::WebTextCheckingResult>*); | 30 virtual void checkTextOfParagraph(const blink::WebString&, blink::WebTextChe
ckingTypeMask, blink::WebVector<blink::WebTextCheckingResult>*); |
| 36 virtual void requestCheckingOfText(const blink::WebString&, | 31 virtual void requestCheckingOfText(const blink::WebString&, |
| 37 const blink::WebVector<uint32_t>&, | 32 const blink::WebVector<uint32_t>&, |
| 38 const blink::WebVector<unsigned>&, | 33 const blink::WebVector<unsigned>&, |
| 39 blink::WebTextCheckingCompletion*); | 34 blink::WebTextCheckingCompletion*); |
| 40 virtual blink::WebString autoCorrectWord(const blink::WebString&); | 35 virtual blink::WebString autoCorrectWord(const blink::WebString&); |
| 41 | 36 |
| 42 private: | 37 private: |
| 43 void finishLastTextCheck(); | 38 void finishLastTextCheck(); |
| 44 | 39 |
| 45 // The mock spellchecker used in spellCheck(). | 40 // The mock spellchecker used in spellCheck(). |
| 46 MockSpellCheck m_spellcheck; | 41 MockSpellCheck m_spellcheck; |
| 47 | 42 |
| 48 blink::WebString m_lastRequestedTextCheckString; | 43 blink::WebString m_lastRequestedTextCheckString; |
| 49 blink::WebTextCheckingCompletion* m_lastRequestedTextCheckingCompletion; | 44 blink::WebTextCheckingCompletion* m_lastRequestedTextCheckingCompletion; |
| 50 | 45 |
| 51 WebTestRunner::WebTaskList m_taskList; | 46 WebTaskList m_taskList; |
| 52 | 47 |
| 53 WebTestRunner::WebTestDelegate* m_delegate; | 48 WebTestDelegate* m_delegate; |
| 54 | 49 |
| 55 content::WebTestProxyBase* m_webTestProxy; | 50 WebTestProxyBase* m_webTestProxy; |
| 56 | 51 |
| 57 DISALLOW_COPY_AND_ASSIGN(SpellCheckClient); | 52 DISALLOW_COPY_AND_ASSIGN(SpellCheckClient); |
| 58 }; | 53 }; |
| 59 | 54 |
| 60 } // namespace content | 55 } // namespace content |
| 61 | 56 |
| 62 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_ | 57 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_ |
| OLD | NEW |