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

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

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/spellcheck_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/spellcheck/renderer/spellcheck_provider.cc
diff --git a/components/spellcheck/renderer/spellcheck_provider.cc b/components/spellcheck/renderer/spellcheck_provider.cc
index 0109d16927304430ce61e992e00755d2650440de..d41219a2ea5cc0b6f53c2d8a42894c58db66ddce 100644
--- a/components/spellcheck/renderer/spellcheck_provider.cc
+++ b/components/spellcheck/renderer/spellcheck_provider.cc
@@ -4,7 +4,6 @@
#include "components/spellcheck/renderer/spellcheck_provider.h"
-#include "base/command_line.h"
#include "base/metrics/histogram_macros.h"
#include "components/spellcheck/common/spellcheck_messages.h"
#include "components/spellcheck/common/spellcheck_result.h"
@@ -39,11 +38,9 @@ SpellCheckProvider::SpellCheckProvider(
SpellCheck* spellcheck)
: content::RenderViewObserver(render_view),
content::RenderViewObserverTracker<SpellCheckProvider>(render_view),
- spelling_panel_visible_(false),
spellcheck_(spellcheck) {
DCHECK(spellcheck_);
if (render_view) { // NULL in unit tests.
- render_view->GetWebView()->setSpellCheckClient(this);
render_view->GetWebView()->setTextCheckClient(this);
EnableSpellcheck(spellcheck_->IsSpellcheckEnabled());
}
@@ -92,10 +89,7 @@ bool SpellCheckProvider::OnMessageReceived(const IPC::Message& message) {
OnRespondSpellingService)
#endif
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
- IPC_MESSAGE_HANDLER(SpellCheckMsg_AdvanceToNextMisspelling,
- OnAdvanceToNextMisspelling)
IPC_MESSAGE_HANDLER(SpellCheckMsg_RespondTextCheck, OnRespondTextCheck)
- IPC_MESSAGE_HANDLER(SpellCheckMsg_ToggleSpellPanel, OnToggleSpellPanel)
#endif
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -155,25 +149,6 @@ void SpellCheckProvider::cancelAllPendingRequests() {
text_check_completions_.Clear();
}
-void SpellCheckProvider::showSpellingUI(bool show) {
-#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
- UMA_HISTOGRAM_BOOLEAN("SpellCheck.api.showUI", show);
- Send(new SpellCheckHostMsg_ShowSpellingPanel(routing_id(), show));
-#endif
-}
-
-bool SpellCheckProvider::isShowingSpellingUI() {
- return spelling_panel_visible_;
-}
-
-void SpellCheckProvider::updateSpellingUIWithMisspelledWord(
- const WebString& word) {
-#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
- Send(new SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord(
- routing_id(), word.utf16()));
-#endif
-}
-
#if !BUILDFLAG(USE_BROWSER_SPELLCHECKER)
void SpellCheckProvider::OnRespondSpellingService(
int identifier,
@@ -224,13 +199,6 @@ bool SpellCheckProvider::HasWordCharacters(
}
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
-void SpellCheckProvider::OnAdvanceToNextMisspelling() {
- if (!render_view()->GetWebView())
- return;
- render_view()->GetWebView()->focusedFrame()->executeCommand(
- WebString::fromUTF8("AdvanceToNextMisspelling"));
-}
-
void SpellCheckProvider::OnRespondTextCheck(
int identifier,
const base::string16& line,
@@ -254,16 +222,6 @@ void SpellCheckProvider::OnRespondTextCheck(
last_request_ = line;
last_results_.swap(textcheck_results);
}
-
-void SpellCheckProvider::OnToggleSpellPanel(bool is_currently_visible) {
- if (!render_view()->GetWebView())
- return;
- // We need to tell the webView whether the spelling panel is visible or not so
- // that it won't need to make ipc calls later.
- spelling_panel_visible_ = is_currently_visible;
- render_view()->GetWebView()->focusedFrame()->executeCommand(
- WebString::fromUTF8("ToggleSpellPanel"));
-}
#endif
void SpellCheckProvider::EnableSpellcheck(bool enable) {
« no previous file with comments | « components/spellcheck/renderer/spellcheck_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698