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

Unified Diff: chrome/renderer/spellchecker/spellcheck_provider.h

Issue 6764001: Update the code to have the SpellCheckProvider implement WebSpellCheckClient, in preparation for ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/spellchecker/spellcheck_provider.h
===================================================================
--- chrome/renderer/spellchecker/spellcheck_provider.h (revision 79702)
+++ chrome/renderer/spellchecker/spellcheck_provider.h (working copy)
@@ -10,6 +10,7 @@
#include "base/id_map.h"
#include "content/renderer/render_view_observer.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebSpellCheckClient.h"
class RenderView;
class SpellCheck;
@@ -22,7 +23,8 @@
// This class deals with invoking browser-side spellcheck mechanism
// which is done asynchronously.
-class SpellCheckProvider : public RenderViewObserver {
+class SpellCheckProvider : public RenderViewObserver,
+ public WebKit::WebSpellCheckClient {
public:
typedef IDMap<WebKit::WebTextCheckingCompletion> WebTextCheckCompletions;
@@ -45,18 +47,50 @@
return text_check_completions_.size();
}
+ int document_tag() const { return document_tag_; }
+
// RenderViewObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message);
private:
- // A message handler that receives async results for RequestTextChecking().
+ // WebKit::WebSpellCheckClient implementation.
+ virtual void spellCheck(const WebKit::WebString& text,
+ int& offset,
+ int& length);
+ virtual void requestCheckingOfText(
+ const WebKit::WebString& text,
+ WebKit::WebTextCheckingCompletion* completion);
+ virtual WebKit::WebString autoCorrectWord(
+ const WebKit::WebString& misspelled_word);
+ virtual void showSpellingUI(bool show);
+ virtual bool isShowingSpellingUI();
+ virtual void updateSpellingUIWithMisspelledWord(
+ const WebKit::WebString& word);
+
+ void OnAdvanceToNextMisspelling();
void OnRespondTextCheck(
int identifier,
int tag,
const std::vector<WebKit::WebTextCheckingResult>& results);
+ void OnToggleSpellCheck();
+ void OnToggleSpellPanel(bool is_currently_visible);
+ // Initializes the document_tag_ member if necessary.
+ void EnsureDocumentTag();
+
// Holds ongoing spellchecking operations, assigns IDs for the IPC routing.
WebTextCheckCompletions text_check_completions_;
+
+#if defined(OS_MACOSX)
gmorrita 2011/03/29 18:28:37 I don't think this ifdef is necessary. How about t
jam 2011/03/29 18:37:54 I was just copying over the existing logic from Re
+ // True if the current RenderView has been assigned a document tag.
+ bool has_document_tag_;
+#endif
+
+ int document_tag_;
+
+ // True if the browser is showing the spelling panel for us.
+ bool spelling_panel_visible_;
+
// Spellcheck implementation for use. Weak reference.
SpellCheck* spellcheck_;

Powered by Google App Engine
This is Rietveld 408576698