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

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

Issue 2799923003: Change SpellCheckProvider into a RenderFrameObserver (Closed)
Patch Set: Tue Apr 11 17:50:52 PDT 2017 Created 3 years, 8 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: components/spellcheck/renderer/spellcheck.cc
diff --git a/components/spellcheck/renderer/spellcheck.cc b/components/spellcheck/renderer/spellcheck.cc
index 697e0ed249970822188f28b263e6b7da9f36dd77..cd1a39774bd47ed7b8d4c72e61e84e171ac42e89 100644
--- a/components/spellcheck/renderer/spellcheck.cc
+++ b/components/spellcheck/renderer/spellcheck.cc
@@ -26,6 +26,8 @@
#include "components/spellcheck/renderer/spellcheck_language.h"
#include "components/spellcheck/renderer/spellcheck_provider.h"
#include "components/spellcheck/spellcheck_build_features.h"
+#include "content/public/renderer/render_frame.h"
+#include "content/public/renderer/render_frame_visitor.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/render_view_visitor.h"
@@ -46,18 +48,18 @@ namespace {
const int kNoOffset = 0;
const int kNoTag = 0;
-class UpdateSpellcheckEnabled : public content::RenderViewVisitor {
+class UpdateSpellcheckEnabled : public content::RenderFrameVisitor {
public:
explicit UpdateSpellcheckEnabled(bool enabled) : enabled_(enabled) {}
- bool Visit(content::RenderView* render_view) override;
+ bool Visit(content::RenderFrame* render_frame) override;
private:
bool enabled_; // New spellcheck-enabled state.
DISALLOW_COPY_AND_ASSIGN(UpdateSpellcheckEnabled);
};
-bool UpdateSpellcheckEnabled::Visit(content::RenderView* render_view) {
- SpellCheckProvider* provider = SpellCheckProvider::Get(render_view);
+bool UpdateSpellcheckEnabled::Visit(content::RenderFrame* render_frame) {
+ SpellCheckProvider* provider = SpellCheckProvider::Get(render_frame);
DCHECK(provider);
provider->EnableSpellcheck(enabled_);
return true;
@@ -224,7 +226,7 @@ void SpellCheck::OnCustomDictionaryChanged(
void SpellCheck::OnEnableSpellCheck(bool enable) {
spellcheck_enabled_ = enable;
UpdateSpellcheckEnabled updater(enable);
- content::RenderView::ForEach(&updater);
+ content::RenderFrame::ForEach(&updater);
}
// TODO(groby): Make sure we always have a spelling engine, even before
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | components/spellcheck/renderer/spellcheck_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698