OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_ | 5 #ifndef CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_ |
6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_ | 6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/id_map.h" | 11 #include "base/id_map.h" |
12 #include "content/renderer/render_view_observer.h" | 12 #include "content/renderer/render_view_observer.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSpellCheckClient.h
" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSpellCheckClient.h
" |
14 | 14 |
| 15 // TODO(jam): remove me once WEBSPELLCHECKCLIENT_HAS_SUGGESTIONS is rolled |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" |
| 17 |
15 class RenderView; | 18 class RenderView; |
16 class SpellCheck; | 19 class SpellCheck; |
17 | 20 |
18 namespace WebKit { | 21 namespace WebKit { |
19 class WebString; | 22 class WebString; |
20 class WebTextCheckingCompletion; | 23 class WebTextCheckingCompletion; |
21 struct WebTextCheckingResult; | 24 struct WebTextCheckingResult; |
22 } | 25 } |
23 | 26 |
24 // This class deals with invoking browser-side spellcheck mechanism | 27 // This class deals with invoking browser-side spellcheck mechanism |
(...skipping 22 matching lines...) Expand all Loading... |
47 return text_check_completions_.size(); | 50 return text_check_completions_.size(); |
48 } | 51 } |
49 | 52 |
50 int document_tag() const { return document_tag_; } | 53 int document_tag() const { return document_tag_; } |
51 | 54 |
52 // RenderViewObserver implementation. | 55 // RenderViewObserver implementation. |
53 virtual bool OnMessageReceived(const IPC::Message& message); | 56 virtual bool OnMessageReceived(const IPC::Message& message); |
54 | 57 |
55 private: | 58 private: |
56 // WebKit::WebSpellCheckClient implementation. | 59 // WebKit::WebSpellCheckClient implementation. |
| 60 virtual void spellCheck( |
| 61 const WebKit::WebString& text, |
| 62 int& offset, |
| 63 int& length, |
| 64 WebKit::WebVector<WebKit::WebString>* optional_suggestions); |
| 65 // TODO(jam): remove me once WEBSPELLCHECKCLIENT_HAS_SUGGESTIONS is rolled |
57 virtual void spellCheck(const WebKit::WebString& text, | 66 virtual void spellCheck(const WebKit::WebString& text, |
58 int& offset, | 67 int& offset, |
59 int& length); | 68 int& length); |
60 virtual void requestCheckingOfText( | 69 virtual void requestCheckingOfText( |
61 const WebKit::WebString& text, | 70 const WebKit::WebString& text, |
62 WebKit::WebTextCheckingCompletion* completion); | 71 WebKit::WebTextCheckingCompletion* completion); |
63 virtual WebKit::WebString autoCorrectWord( | 72 virtual WebKit::WebString autoCorrectWord( |
64 const WebKit::WebString& misspelled_word); | 73 const WebKit::WebString& misspelled_word); |
65 virtual void showSpellingUI(bool show); | 74 virtual void showSpellingUI(bool show); |
66 virtual bool isShowingSpellingUI(); | 75 virtual bool isShowingSpellingUI(); |
(...skipping 24 matching lines...) Expand all Loading... |
91 // True if the browser is showing the spelling panel for us. | 100 // True if the browser is showing the spelling panel for us. |
92 bool spelling_panel_visible_; | 101 bool spelling_panel_visible_; |
93 | 102 |
94 // Spellcheck implementation for use. Weak reference. | 103 // Spellcheck implementation for use. Weak reference. |
95 SpellCheck* spellcheck_; | 104 SpellCheck* spellcheck_; |
96 | 105 |
97 DISALLOW_COPY_AND_ASSIGN(SpellCheckProvider); | 106 DISALLOW_COPY_AND_ASSIGN(SpellCheckProvider); |
98 }; | 107 }; |
99 | 108 |
100 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_ | 109 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_ |
OLD | NEW |