| 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 COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_PROVIDER_H_ | 5 #ifndef COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_PROVIDER_H_ |
| 6 #define COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_PROVIDER_H_ | 6 #define COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 public content::RenderViewObserverTracker<SpellCheckProvider>, | 35 public content::RenderViewObserverTracker<SpellCheckProvider>, |
| 36 public blink::WebSpellCheckClient { | 36 public blink::WebSpellCheckClient { |
| 37 public: | 37 public: |
| 38 using WebTextCheckCompletions = IDMap<blink::WebTextCheckingCompletion*>; | 38 using WebTextCheckCompletions = IDMap<blink::WebTextCheckingCompletion*>; |
| 39 | 39 |
| 40 SpellCheckProvider(content::RenderView* render_view, | 40 SpellCheckProvider(content::RenderView* render_view, |
| 41 SpellCheck* spellcheck); | 41 SpellCheck* spellcheck); |
| 42 ~SpellCheckProvider() override; | 42 ~SpellCheckProvider() override; |
| 43 | 43 |
| 44 // Requests async spell and grammar checker to the platform text | 44 // Requests async spell and grammar checker to the platform text |
| 45 // checker, which is available on the browser process. | 45 // checker, which is available on the browser process. The function does not |
| 46 // have special handling for partial words, as Blink guarantees that no |
| 47 // request is made when typing in the middle of a word. |
| 46 void RequestTextChecking( | 48 void RequestTextChecking( |
| 47 const base::string16& text, | 49 const base::string16& text, |
| 48 blink::WebTextCheckingCompletion* completion, | 50 blink::WebTextCheckingCompletion* completion, |
| 49 const std::vector<SpellCheckMarker>& markers); | 51 const std::vector<SpellCheckMarker>& markers); |
| 50 | 52 |
| 51 // The number of ongoing IPC requests. | 53 // The number of ongoing IPC requests. |
| 52 size_t pending_text_request_size() const { | 54 size_t pending_text_request_size() const { |
| 53 return text_check_completions_.size(); | 55 return text_check_completions_.size(); |
| 54 } | 56 } |
| 55 | 57 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // True if the browser is showing the spelling panel for us. | 128 // True if the browser is showing the spelling panel for us. |
| 127 bool spelling_panel_visible_; | 129 bool spelling_panel_visible_; |
| 128 | 130 |
| 129 // Weak pointer to shared (per RenderView) spellcheck data. | 131 // Weak pointer to shared (per RenderView) spellcheck data. |
| 130 SpellCheck* spellcheck_; | 132 SpellCheck* spellcheck_; |
| 131 | 133 |
| 132 DISALLOW_COPY_AND_ASSIGN(SpellCheckProvider); | 134 DISALLOW_COPY_AND_ASSIGN(SpellCheckProvider); |
| 133 }; | 135 }; |
| 134 | 136 |
| 135 #endif // COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_PROVIDER_H_ | 137 #endif // COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_PROVIDER_H_ |
| OLD | NEW |