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

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

Issue 2792233003: Split SpellCheckPanel off SpellCheckProvider (Closed)
Patch Set: Remove histograms.xml from patch 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
« no previous file with comments | « components/spellcheck/renderer/BUILD.gn ('k') | components/spellcheck/renderer/spellcheck_panel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/spellcheck/renderer/spellcheck_panel.h
diff --git a/components/spellcheck/renderer/spellcheck_panel.h b/components/spellcheck/renderer/spellcheck_panel.h
new file mode 100644
index 0000000000000000000000000000000000000000..2319dd94cdaa95380d460aff678ecbda23843b60
--- /dev/null
+++ b/components/spellcheck/renderer/spellcheck_panel.h
@@ -0,0 +1,49 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_PANEL_H
+#define COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_PANEL_H
+
+#include "base/macros.h"
+#include "components/spellcheck/spellcheck_build_features.h"
+#include "content/public/renderer/render_view_observer.h"
+#include "content/public/renderer/render_view_observer_tracker.h"
+#include "third_party/WebKit/public/web/WebSpellCheckClient.h"
+
+// TODO(xiaochengh): Only Mac has spelling panel. Remove the #if checks in this
+// class, which seem unnecessary, and make sure that this class is compiled and
+// used only on Mac.
+class SpellCheckPanel
+ : public content::RenderViewObserver,
+ public content::RenderViewObserverTracker<SpellCheckPanel>,
+ public blink::WebSpellCheckClient {
+ public:
+ explicit SpellCheckPanel(content::RenderView* render_view);
+ ~SpellCheckPanel() override;
+
+ // RenderViewObserver implementation.
+ bool OnMessageReceived(const IPC::Message& message) override;
+
+ private:
+ // RenderViewObserver implementation.
+ void OnDestruct() override;
+
+ // blink::WebSpellCheckClient implementation.
+ void showSpellingUI(bool show) override;
+ bool isShowingSpellingUI() override;
+ void updateSpellingUIWithMisspelledWord(
+ const blink::WebString& word) override;
+
+#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
+ void OnAdvanceToNextMisspelling();
+ void OnToggleSpellPanel(bool is_currently_visible);
+#endif
+
+ // True if the browser is showing the spelling panel for us.
+ bool spelling_panel_visible_;
+
+ DISALLOW_COPY_AND_ASSIGN(SpellCheckPanel);
+};
+
+#endif
« no previous file with comments | « components/spellcheck/renderer/BUILD.gn ('k') | components/spellcheck/renderer/spellcheck_panel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698