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

Unified Diff: chrome/renderer/spellchecker/spellcheck_provider.cc

Issue 1210943008: Patch 2: Added a preprocessor flag for platform spellcheck. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enable_spellcheck_flag
Patch Set: Declared the preprocessor flag in build/config/features.gni Created 5 years, 5 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 | « chrome/renderer/spellchecker/spellcheck_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/spellchecker/spellcheck_provider.cc
diff --git a/chrome/renderer/spellchecker/spellcheck_provider.cc b/chrome/renderer/spellchecker/spellcheck_provider.cc
index 840f3fb9508b9ed4b60ce2eaca1bebff3049ad34..cc11f5648d8f2c7a627030291b6e16d801db8dd7 100644
--- a/chrome/renderer/spellchecker/spellcheck_provider.cc
+++ b/chrome/renderer/spellchecker/spellcheck_provider.cc
@@ -72,7 +72,7 @@ void SpellCheckProvider::RequestTextChecking(
last_request_.clear();
last_results_.assign(blink::WebVector<blink::WebTextCheckingResult>());
-#if defined(OS_MACOSX)
+#if defined(USE_PLATFORM_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
@@ -88,17 +88,17 @@ void SpellCheckProvider::RequestTextChecking(
text_check_completions_.Add(completion),
base::string16(text),
markers));
-#endif // !OS_MACOSX
+#endif // !USE_PLATFORM_SPELLCHECKER
}
bool SpellCheckProvider::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(SpellCheckProvider, message)
-#if !defined(OS_MACOSX)
+#if !defined(USE_PLATFORM_SPELLCHECKER)
IPC_MESSAGE_HANDLER(SpellCheckMsg_RespondSpellingService,
OnRespondSpellingService)
#endif
-#if defined(OS_MACOSX)
+#if defined(USE_PLATFORM_SPELLCHECKER)
IPC_MESSAGE_HANDLER(SpellCheckMsg_AdvanceToNextMisspelling,
OnAdvanceToNextMisspelling)
IPC_MESSAGE_HANDLER(SpellCheckMsg_RespondTextCheck, OnRespondTextCheck)
@@ -110,7 +110,7 @@ bool SpellCheckProvider::OnMessageReceived(const IPC::Message& message) {
}
void SpellCheckProvider::FocusedNodeChanged(const blink::WebNode& unused) {
-#if defined(OS_MACOSX)
+#if defined(USE_PLATFORM_SPELLCHECKER)
WebFrame* frame = render_view()->GetWebView()->focusedFrame();
WebElement element = frame->document().isNull() ? WebElement() :
frame->document().focusedElement();
@@ -120,7 +120,7 @@ void SpellCheckProvider::FocusedNodeChanged(const blink::WebNode& unused) {
frame->isContinuousSpellCheckingEnabled();
Send(new SpellCheckHostMsg_ToggleSpellCheck(routing_id(), enabled, checked));
-#endif // OS_MACOSX
+#endif // USE_PLATFORM_SPELLCHECKER
}
void SpellCheckProvider::spellCheck(
@@ -186,7 +186,7 @@ WebString SpellCheckProvider::autoCorrectWord(const WebString& word) {
}
void SpellCheckProvider::showSpellingUI(bool show) {
-#if defined(OS_MACOSX)
+#if defined(USE_PLATFORM_SPELLCHECKER)
UMA_HISTOGRAM_BOOLEAN("SpellCheck.api.showUI", show);
Send(new SpellCheckHostMsg_ShowSpellingPanel(routing_id(), show));
#endif
@@ -198,13 +198,13 @@ bool SpellCheckProvider::isShowingSpellingUI() {
void SpellCheckProvider::updateSpellingUIWithMisspelledWord(
const WebString& word) {
-#if defined(OS_MACOSX)
+#if defined(USE_PLATFORM_SPELLCHECKER)
Send(new SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord(routing_id(),
word));
#endif
}
-#if !defined(OS_MACOSX)
+#if !defined(USE_PLATFORM_SPELLCHECKER)
void SpellCheckProvider::OnRespondSpellingService(
int identifier,
bool succeeded,
@@ -253,7 +253,7 @@ bool SpellCheckProvider::HasWordCharacters(
return false;
}
-#if defined(OS_MACOSX)
+#if defined(USE_PLATFORM_SPELLCHECKER)
void SpellCheckProvider::OnAdvanceToNextMisspelling() {
if (!render_view()->GetWebView())
return;
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698