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

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

Issue 1162373002: Make some editing/selection functions accessible to c/b/renderer_host/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switched to oninput event as oncut/onpaste happen before cut/paste Created 5 years, 6 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
diff --git a/content/browser/renderer_host/ime_adapter_android.cc b/content/browser/renderer_host/ime_adapter_android.cc
index ac820f5765c3a7bf214293e8271e7bba7951f972..c0c16ed96ddb5881225b82af30535c71882aac43 100644
--- a/content/browser/renderer_host/ime_adapter_android.cc
+++ b/content/browser/renderer_host/ime_adapter_android.cc
@@ -18,6 +18,7 @@
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/renderer_host/render_widget_host_delegate.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/frame_messages.h"
@@ -282,21 +283,24 @@ void ImeAdapterAndroid::SelectAll(JNIEnv* env, jobject) {
}
void ImeAdapterAndroid::Cut(JNIEnv* env, jobject) {
- WebContents* wc = GetWebContents();
- if (wc)
- wc->Cut();
+ RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
+ RenderWidgetHostDelegate* delegate = rwh ? rwh->delegate() : nullptr;
+ if (delegate)
+ delegate->Cut();
}
void ImeAdapterAndroid::Copy(JNIEnv* env, jobject) {
- WebContents* wc = GetWebContents();
- if (wc)
- wc->Copy();
+ RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
+ RenderWidgetHostDelegate* delegate = rwh ? rwh->delegate() : nullptr;
+ if (delegate)
+ delegate->Copy();
}
void ImeAdapterAndroid::Paste(JNIEnv* env, jobject) {
- WebContents* wc = GetWebContents();
- if (wc)
- wc->Paste();
+ RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
+ RenderWidgetHostDelegate* delegate = rwh ? rwh->delegate() : nullptr;
+ if (delegate)
+ delegate->Paste();
}
void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) {

Powered by Google App Engine
This is Rietveld 408576698