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

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

Issue 183923030: Almost finish moving context_menu_node_ from RenderViewImpl to RenderFrameImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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/ime_adapter_android.cc
===================================================================
--- content/browser/renderer_host/ime_adapter_android.cc (revision 254898)
+++ content/browser/renderer_host/ime_adapter_android.cc (working copy)
@@ -11,6 +11,8 @@
#include "base/android/scoped_java_ref.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
+#include "content/browser/frame_host/render_frame_host_impl.h"
+#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_android.h"
#include "content/common/view_messages.h"
@@ -240,27 +242,21 @@
}
void ImeAdapterAndroid::Cut(JNIEnv* env, jobject) {
- RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
- if (!rwhi)
- return;
-
- rwhi->Cut();
+ RenderFrameHost* rfh = GetRenderFrameHost();
+ if (rfh)
+ rfh->Cut();
}
void ImeAdapterAndroid::Copy(JNIEnv* env, jobject) {
- RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
- if (!rwhi)
- return;
-
- rwhi->Copy();
+ RenderFrameHost* rfh = GetRenderFrameHost();
+ if (rfh)
+ rfh->Copy();
}
void ImeAdapterAndroid::Paste(JNIEnv* env, jobject) {
- RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
- if (!rwhi)
- return;
-
- rwhi->Paste();
+ RenderFrameHost* rfh = GetRenderFrameHost();
+ if (rfh)
+ rfh->Paste();
}
void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) {
@@ -276,4 +272,14 @@
return RenderWidgetHostImpl::From(rwh);
}
+RenderFrameHost* ImeAdapterAndroid::GetRenderFrameHost() {
nasko 2014/03/05 21:50:47 nit: Shouldn't this be GetFocusedRenderFrameHost?
jam 2014/03/06 00:59:37 Done.
+ RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
+ if (!rwh)
+ return NULL;
+ if (!rwh->IsRenderView())
+ return NULL;
+ RenderViewHost* rvh = RenderViewHost::From(rwh);
+ return rvh->GetFocusedFrame();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698