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

Unified Diff: webkit/glue/editor_client_impl.cc

Issue 160565: Adds support for the os x spelling panel to chromium. Users can... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 3 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/render_view.cc ('k') | webkit/glue/webframe_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/editor_client_impl.cc
===================================================================
--- webkit/glue/editor_client_impl.cc (revision 25643)
+++ webkit/glue/editor_client_impl.cc (working copy)
@@ -152,7 +152,13 @@
}
int EditorClientImpl::spellCheckerDocumentTag() {
+#if defined(OS_MACOSX)
+ WebViewDelegate* d = web_view_->delegate();
+ if (d)
+ return d->SpellCheckerDocumentTag();
+#else
NOTIMPLEMENTED();
+#endif // OS_MACOSX
return 0;
}
@@ -838,7 +844,8 @@
if (isContinuousSpellCheckingEnabled() && d) {
std::wstring word =
webkit_glue::StringToStdWString(WebCore::String(str, length));
- d->SpellCheck(word, &spell_location, &spell_length);
+ d->SpellCheck(word, spellCheckerDocumentTag(),
+ &spell_location, &spell_length);
} else {
spell_location = 0;
spell_length = 0;
@@ -867,7 +874,8 @@
return WebCore::String();
}
- std::wstring autocorrect_word = d->GetAutoCorrectWord(word);
+ std::wstring autocorrect_word =
+ d->GetAutoCorrectWord(word, spellCheckerDocumentTag());
return webkit_glue::StdWStringToString(autocorrect_word);
}
@@ -887,16 +895,28 @@
NOTIMPLEMENTED();
}
-void EditorClientImpl::updateSpellingUIWithMisspelledWord(const WebCore::String&) {
- NOTIMPLEMENTED();
+void EditorClientImpl::updateSpellingUIWithMisspelledWord(
+ const WebCore::String& misspelled_word) {
+ std::wstring word = webkit_glue::StringToStdWString(misspelled_word);
+ WebViewDelegate* d = web_view_->delegate();
+ if (d) {
+ d->UpdateSpellingUIWithMisspelledWord(word);
+ }
}
void EditorClientImpl::showSpellingUI(bool show) {
- NOTIMPLEMENTED();
+ WebViewDelegate* d = web_view_->delegate();
+ if (d) {
+ d->ShowSpellingUI(show);
+ }
}
bool EditorClientImpl::spellingUIIsShowing() {
- return false;
+ // SpellingPanel visibility is stored in the web_view_ every time a toggle
+ // message is sent from the browser. If we were to send a message to the
+ // browser and ask for the visibility, then we run into problems accessing
+ // cocoa methods on the UI thread.
+ return web_view_->GetSpellingPanelVisibility();
}
void EditorClientImpl::getGuessesForWord(const WebCore::String&,
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | webkit/glue/webframe_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698