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

Unified Diff: content/browser/renderer_host/gtk_im_context_wrapper.cc

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR, fix a weird runtime issue. Created 8 years, 10 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
Index: content/browser/renderer_host/gtk_im_context_wrapper.cc
diff --git a/content/browser/renderer_host/gtk_im_context_wrapper.cc b/content/browser/renderer_host/gtk_im_context_wrapper.cc
index 3ca6117cfbd9ecf5ba676b5a2f9848d8058ceb2d..73b13c0d2c656130faffe9bfe112cc3ffa105a18 100644
--- a/content/browser/renderer_host/gtk_im_context_wrapper.cc
+++ b/content/browser/renderer_host/gtk_im_context_wrapper.cc
@@ -284,8 +284,7 @@ void GtkIMContextWrapper::OnFocusIn() {
// Enables RenderWidget's IME related events, so that we can be notified
// when WebKit wants to enable or disable IME.
if (host_view_->GetRenderWidgetHost())
- static_cast<RenderWidgetHostImpl*>(
- host_view_->GetRenderWidgetHost())->SetInputMethodActive(true);
+ host_view_->GetRenderWidgetHost()->AsRWHImpl()->SetInputMethodActive(true);
}
void GtkIMContextWrapper::OnFocusOut() {
@@ -312,8 +311,7 @@ void GtkIMContextWrapper::OnFocusOut() {
// Disable RenderWidget's IME related events to save bandwidth.
if (host_view_->GetRenderWidgetHost())
- static_cast<RenderWidgetHostImpl*>(
- host_view_->GetRenderWidgetHost())->SetInputMethodActive(false);
+ host_view_->GetRenderWidgetHost()->AsRWHImpl()->SetInputMethodActive(false);
}
#if !defined(TOOLKIT_VIEWS)
@@ -472,8 +470,7 @@ void GtkIMContextWrapper::ConfirmComposition() {
if (is_composing_text_) {
if (host_view_->GetRenderWidgetHost())
- static_cast<RenderWidgetHostImpl*>(
- host_view_->GetRenderWidgetHost())->ImeConfirmComposition();
+ host_view_->GetRenderWidgetHost()->AsRWHImpl()->ImeConfirmComposition();
// Reset the input method.
CancelComposition();
@@ -498,8 +495,7 @@ void GtkIMContextWrapper::HandleCommit(const string16& text) {
if (!is_in_key_event_handler_ && host_view_->GetRenderWidgetHost()) {
// Workaround http://crbug.com/45478 by sending fake key down/up events.
SendFakeCompositionKeyEvent(WebKit::WebInputEvent::RawKeyDown);
- static_cast<RenderWidgetHostImpl*>(
- host_view_->GetRenderWidgetHost())->ImeConfirmComposition(text);
+ host_view_->GetRenderWidgetHost()->AsRWHImpl()->ImeConfirmComposition(text);
SendFakeCompositionKeyEvent(WebKit::WebInputEvent::KeyUp);
}
}
@@ -547,8 +543,7 @@ void GtkIMContextWrapper::HandlePreeditChanged(const gchar* text,
const std::vector<WebKit::WebCompositionUnderline>& underlines =
reinterpret_cast<const std::vector<WebKit::WebCompositionUnderline>&>(
composition_.underlines);
- static_cast<RenderWidgetHostImpl*>(
- host_view_->GetRenderWidgetHost())->ImeSetComposition(
+ host_view_->GetRenderWidgetHost()->AsRWHImpl()->ImeSetComposition(
composition_.text, underlines, composition_.selection.start(),
composition_.selection.end());
SendFakeCompositionKeyEvent(WebKit::WebInputEvent::KeyUp);
@@ -565,8 +560,7 @@ void GtkIMContextWrapper::HandlePreeditEnd() {
// we need inform webkit to clear it.
// It's only necessary when it's not in ProcessKeyEvent ().
if (!is_in_key_event_handler_ && host_view_->GetRenderWidgetHost())
- static_cast<RenderWidgetHostImpl*>(
- host_view_->GetRenderWidgetHost())->ImeCancelComposition();
+ host_view_->GetRenderWidgetHost()->AsRWHImpl()->ImeCancelComposition();
}
// Don't set is_composing_text_ to false here, because "preedit_end"

Powered by Google App Engine
This is Rietveld 408576698