[safe-browsing] Database full hash matches like prefix match.
[chromium-blink-merge.git] / content / shell / renderer / test_runner / SpellCheckClient.h
bloba2b26a79a7eb2c82c348adf184bf5c4cfbca37f7
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_
8 #include "base/basictypes.h"
9 #include "content/shell/renderer/test_runner/MockSpellCheck.h"
10 #include "content/shell/renderer/test_runner/WebTask.h"
11 #include "third_party/WebKit/public/web/WebSpellCheckClient.h"
13 namespace content {
14 class WebTestProxyBase;
17 namespace WebTestRunner {
19 class WebTestDelegate;
21 class SpellCheckClient : public blink::WebSpellCheckClient {
22 public:
23 explicit SpellCheckClient(content::WebTestProxyBase*);
24 virtual ~SpellCheckClient();
26 void setDelegate(WebTestDelegate*);
28 WebTaskList* taskList() { return &m_taskList; }
29 MockSpellCheck* mockSpellCheck() { return &m_spellcheck; }
31 // blink::WebSpellCheckClient implementation.
32 virtual void spellCheck(const blink::WebString&, int& offset, int& length, blink::WebVector<blink::WebString>* optionalSuggestions);
33 virtual void checkTextOfParagraph(const blink::WebString&, blink::WebTextCheckingTypeMask, blink::WebVector<blink::WebTextCheckingResult>*);
34 virtual void requestCheckingOfText(const blink::WebString&,
35 const blink::WebVector<uint32_t>&,
36 const blink::WebVector<unsigned>&,
37 blink::WebTextCheckingCompletion*);
38 virtual blink::WebString autoCorrectWord(const blink::WebString&);
40 private:
41 void finishLastTextCheck();
43 // The mock spellchecker used in spellCheck().
44 MockSpellCheck m_spellcheck;
46 blink::WebString m_lastRequestedTextCheckString;
47 blink::WebTextCheckingCompletion* m_lastRequestedTextCheckingCompletion;
49 WebTaskList m_taskList;
51 WebTestDelegate* m_delegate;
53 content::WebTestProxyBase* m_webTestProxy;
55 DISALLOW_COPY_AND_ASSIGN(SpellCheckClient);
60 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_