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

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

Issue 2495193003: Convert spellcheck to a buildflag header. (Closed)
Patch Set: Comment Created 4 years, 1 month 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_provider.cc
diff --git a/components/spellcheck/renderer/spellcheck_provider.cc b/components/spellcheck/renderer/spellcheck_provider.cc
index f52fe596705c94e675d860375170502247e45779..bd91fc57664670af07885ea74db512df75b5baa7 100644
--- a/components/spellcheck/renderer/spellcheck_provider.cc
+++ b/components/spellcheck/renderer/spellcheck_provider.cc
@@ -11,6 +11,7 @@
#include "components/spellcheck/common/spellcheck_result.h"
#include "components/spellcheck/renderer/spellcheck.h"
#include "components/spellcheck/renderer/spellcheck_language.h"
+#include "components/spellcheck/spellcheck_build_features.h"
#include "content/public/renderer/render_view.h"
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebDocument.h"
@@ -72,7 +73,7 @@ void SpellCheckProvider::RequestTextChecking(
last_request_.clear();
last_results_.assign(blink::WebVector<blink::WebTextCheckingResult>());
-#if defined(USE_BROWSER_SPELLCHECKER)
+#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
// Text check (unified request for grammar and spell check) is only
// available for browser process, so we ask the system spellchecker
// over IPC or return an empty result if the checker is not
@@ -94,11 +95,11 @@ void SpellCheckProvider::RequestTextChecking(
bool SpellCheckProvider::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(SpellCheckProvider, message)
-#if !defined(USE_BROWSER_SPELLCHECKER)
+#if !BUILDFLAG(USE_BROWSER_SPELLCHECKER)
IPC_MESSAGE_HANDLER(SpellCheckMsg_RespondSpellingService,
OnRespondSpellingService)
#endif
-#if defined(USE_BROWSER_SPELLCHECKER)
+#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
IPC_MESSAGE_HANDLER(SpellCheckMsg_AdvanceToNextMisspelling,
OnAdvanceToNextMisspelling)
IPC_MESSAGE_HANDLER(SpellCheckMsg_RespondTextCheck, OnRespondTextCheck)
@@ -110,7 +111,7 @@ bool SpellCheckProvider::OnMessageReceived(const IPC::Message& message) {
}
void SpellCheckProvider::FocusedNodeChanged(const blink::WebNode& unused) {
-#if defined(USE_BROWSER_SPELLCHECKER)
+#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
WebLocalFrame* frame = render_view()->GetWebView()->focusedFrame();
WebElement element = frame->document().isNull() ? WebElement() :
frame->document().focusedElement();
@@ -166,7 +167,7 @@ void SpellCheckProvider::cancelAllPendingRequests() {
}
void SpellCheckProvider::showSpellingUI(bool show) {
-#if defined(USE_BROWSER_SPELLCHECKER)
+#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
UMA_HISTOGRAM_BOOLEAN("SpellCheck.api.showUI", show);
Send(new SpellCheckHostMsg_ShowSpellingPanel(routing_id(), show));
#endif
@@ -178,13 +179,13 @@ bool SpellCheckProvider::isShowingSpellingUI() {
void SpellCheckProvider::updateSpellingUIWithMisspelledWord(
const WebString& word) {
-#if defined(USE_BROWSER_SPELLCHECKER)
+#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
Send(new SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord(routing_id(),
word));
#endif
}
-#if !defined(USE_BROWSER_SPELLCHECKER)
+#if !BUILDFLAG(USE_BROWSER_SPELLCHECKER)
void SpellCheckProvider::OnRespondSpellingService(
int identifier,
bool succeeded,
@@ -233,7 +234,7 @@ bool SpellCheckProvider::HasWordCharacters(
return false;
}
-#if defined(USE_BROWSER_SPELLCHECKER)
+#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
void SpellCheckProvider::OnAdvanceToNextMisspelling() {
if (!render_view()->GetWebView())
return;
« no previous file with comments | « components/spellcheck/renderer/spellcheck_provider.h ('k') | components/spellcheck/renderer/spellcheck_provider_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698