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

Unified Diff: components/spellcheck/renderer/spellcheck.h

Issue 2828313002: Convert render process component common Spellcheck IPC to mojo (Closed)
Patch Set: Build fix. Created 3 years, 7 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
« no previous file with comments | « components/spellcheck/renderer/DEPS ('k') | components/spellcheck/renderer/spellcheck.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/spellcheck/renderer/spellcheck.h
diff --git a/components/spellcheck/renderer/spellcheck.h b/components/spellcheck/renderer/spellcheck.h
index 4e8582537fe0915eafdc90936275c147dd6ddc93..c5a839f7ba699cf5763823002805e7e453bff455 100644
--- a/components/spellcheck/renderer/spellcheck.h
+++ b/components/spellcheck/renderer/spellcheck.h
@@ -15,11 +15,12 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
+#include "components/spellcheck/common/spellcheck.mojom.h"
#include "components/spellcheck/renderer/custom_dictionary_engine.h"
#include "components/spellcheck/spellcheck_build_features.h"
#include "content/public/renderer/render_thread_observer.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
-struct SpellCheckBDictLanguage;
class SpellcheckLanguage;
struct SpellCheckResult;
@@ -29,8 +30,8 @@ struct WebTextCheckingResult;
template <typename T> class WebVector;
}
-namespace IPC {
-class Message;
+namespace service_manager {
+struct BindSourceInfo;
}
// TODO(morrita): Needs reorg with SpellCheckProvider.
@@ -38,7 +39,8 @@ class Message;
// Shared spellchecking logic/data for a RenderProcess. All RenderViews use
// this object to perform spellchecking tasks.
class SpellCheck : public content::RenderThreadObserver,
- public base::SupportsWeakPtr<SpellCheck> {
+ public base::SupportsWeakPtr<SpellCheck>,
+ public spellcheck::mojom::SpellChecker {
public:
// TODO(groby): I wonder if this can be private, non-mac only.
class SpellcheckRequest;
@@ -121,15 +123,18 @@ class SpellCheck : public content::RenderThreadObserver,
const std::vector<std::vector<base::string16>>& suggestions_list,
std::vector<base::string16>* optional_suggestions);
- // RenderThreadObserver implementation:
- bool OnControlMessageReceived(const IPC::Message& message) override;
+ // Binds requests for the SpellChecker interface.
+ void SpellCheckerRequest(const service_manager::BindSourceInfo& source_info,
+ spellcheck::mojom::SpellCheckerRequest request);
- // Message handlers.
- void OnInit(const std::vector<SpellCheckBDictLanguage>& bdict_languages,
- const std::set<std::string>& custom_words);
- void OnCustomDictionaryChanged(const std::set<std::string>& words_added,
- const std::set<std::string>& words_removed);
- void OnEnableSpellCheck(bool enable);
+ // spellcheck::mojom::SpellChecker:
+ void Initialize(
+ std::vector<spellcheck::mojom::SpellCheckBDictLanguagePtr> dictionaries,
+ const std::vector<std::string>& custom_words,
+ bool enable) override;
+ void CustomDictionaryChanged(
+ const std::vector<std::string>& words_added,
+ const std::vector<std::string>& words_removed) override;
#if !BUILDFLAG(USE_BROWSER_SPELLCHECKER)
// Posts delayed spellcheck task and clear it if any.
@@ -147,6 +152,9 @@ class SpellCheck : public content::RenderThreadObserver,
std::unique_ptr<SpellcheckRequest> pending_request_param_;
#endif
+ // Bindings for SpellChecker clients.
+ mojo::BindingSet<spellcheck::mojom::SpellChecker> spellchecker_bindings_;
+
// A vector of objects used to actually check spelling, one for each enabled
// language.
std::vector<std::unique_ptr<SpellcheckLanguage>> languages_;
« no previous file with comments | « components/spellcheck/renderer/DEPS ('k') | components/spellcheck/renderer/spellcheck.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698