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