Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/renderer/spellchecker/spellcheck_provider.h

Issue 11476005: [Spellcheck] Make sure context menu and actual spellcheck state are in sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 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 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/id_map.h" 10 #include "base/id_map.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 WebKit::WebTextCheckingCompletion* completion); 42 WebKit::WebTextCheckingCompletion* completion);
43 43
44 // The number of ongoing IPC requests. 44 // The number of ongoing IPC requests.
45 size_t pending_text_request_size() const { 45 size_t pending_text_request_size() const {
46 return text_check_completions_.size(); 46 return text_check_completions_.size();
47 } 47 }
48 48
49 // Replace shared spellcheck data. 49 // Replace shared spellcheck data.
50 void set_spellcheck(SpellCheck* spellcheck) { spellcheck_ = spellcheck; } 50 void set_spellcheck(SpellCheck* spellcheck) { spellcheck_ = spellcheck; }
51 51
52 // Enables document-wide spellchecking.
53 void EnableSpellCheck(bool enabled);
rpetterson 2012/12/06 22:21:53 nit: I thought we were moving to Spellcheck vs. Sp
groby-ooo-7-16 2012/12/11 20:19:55 Done.
54
52 // RenderViewObserver implementation. 55 // RenderViewObserver implementation.
53 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
54 virtual void FocusedNodeChanged(const WebKit::WebNode& node) OVERRIDE; 57 virtual void FocusedNodeChanged(const WebKit::WebNode& node) OVERRIDE;
55 58
56 private: 59 private:
57 friend class TestingSpellCheckProvider; 60 friend class TestingSpellCheckProvider;
58 61
59 #if !defined(OS_MACOSX) 62 #if !defined(OS_MACOSX)
60 // Tries to satisfy a spell check request from the cache in |last_request_|. 63 // Tries to satisfy a spell check request from the cache in |last_request_|.
61 // Returns true (and cancels/finishes the completion) if it can, false 64 // Returns true (and cancels/finishes the completion) if it can, false
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // needs to check this text. 99 // needs to check this text.
97 bool HasWordCharacters(const WebKit::WebString& text, int index) const; 100 bool HasWordCharacters(const WebKit::WebString& text, int index) const;
98 #endif 101 #endif
99 #if defined(OS_MACOSX) 102 #if defined(OS_MACOSX)
100 void OnAdvanceToNextMisspelling(); 103 void OnAdvanceToNextMisspelling();
101 void OnRespondTextCheck( 104 void OnRespondTextCheck(
102 int identifier, 105 int identifier,
103 const std::vector<SpellCheckResult>& results); 106 const std::vector<SpellCheckResult>& results);
104 void OnToggleSpellPanel(bool is_currently_visible); 107 void OnToggleSpellPanel(bool is_currently_visible);
105 #endif 108 #endif
106 void OnToggleSpellCheck();
107 109
108 // Holds ongoing spellchecking operations, assigns IDs for the IPC routing. 110 // Holds ongoing spellchecking operations, assigns IDs for the IPC routing.
109 WebTextCheckCompletions text_check_completions_; 111 WebTextCheckCompletions text_check_completions_;
110 112
111 #if !defined(OS_MACOSX) 113 #if !defined(OS_MACOSX)
112 // The last text sent to the browser process to spellcheck it and its 114 // The last text sent to the browser process to spellcheck it and its
113 // spellchecking results. 115 // spellchecking results.
114 string16 last_request_; 116 string16 last_request_;
115 WebKit::WebVector<WebKit::WebTextCheckingResult> last_results_; 117 WebKit::WebVector<WebKit::WebTextCheckingResult> last_results_;
116 #endif 118 #endif
117 119
118 // True if the browser is showing the spelling panel for us. 120 // True if the browser is showing the spelling panel for us.
119 bool spelling_panel_visible_; 121 bool spelling_panel_visible_;
120 122
121 // Weak pointer to shared (per RenderView) spellcheck data. 123 // Weak pointer to shared (per RenderView) spellcheck data.
122 SpellCheck* spellcheck_; 124 SpellCheck* spellcheck_;
123 125
124 DISALLOW_COPY_AND_ASSIGN(SpellCheckProvider); 126 DISALLOW_COPY_AND_ASSIGN(SpellCheckProvider);
125 }; 127 };
126 128
127 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_ 129 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698