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

Unified Diff: content/browser/frame_host/interstitial_page_impl.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: Rebased (after editing commands were removed from ImeAdapterAndroid: crrev.com/336407) 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/frame_host/interstitial_page_impl.cc
diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc
index 4bf1b1781da1bd9d25ad4a914b88636b76e7af8e..2c91202368118cb5e5425850eb3981a78004c34d 100644
--- a/content/browser/frame_host/interstitial_page_impl.cc
+++ b/content/browser/frame_host/interstitial_page_impl.cc
@@ -29,6 +29,7 @@
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/web_contents/web_contents_view.h"
#include "content/common/frame_messages.h"
+#include "content/common/input_messages.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
@@ -426,6 +427,39 @@ AccessibilityMode InterstitialPageImpl::GetAccessibilityMode() const {
return AccessibilityModeOff;
}
+void InterstitialPageImpl::Cut() {
+ FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame();
+ RenderFrameHostImpl* focused_frame =
+ focused_node ? focused_node->current_frame_host() : nullptr;
+ if (!focused_frame)
dcheng 2015/06/29 17:58:02 Question: can you have a situation where focused_n
mohsen 2015/06/29 21:46:53 This is the case I saw in tests and that's why I e
+ return;
+
+ focused_frame->Send(new InputMsg_Cut(focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("Cut"));
+}
+
+void InterstitialPageImpl::Copy() {
+ FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame();
+ RenderFrameHostImpl* focused_frame =
+ focused_node ? focused_node->current_frame_host() : nullptr;
+ if (!focused_frame)
+ return;
+
+ focused_frame->Send(new InputMsg_Copy(focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("Copy"));
+}
+
+void InterstitialPageImpl::Paste() {
+ FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame();
+ RenderFrameHostImpl* focused_frame =
+ focused_node ? focused_node->current_frame_host() : nullptr;
+ if (!focused_frame)
+ return;
dcheng 2015/06/29 17:58:02 It almost seems like we should have a helper for t
mohsen 2015/06/29 21:46:53 Not applicable, anymore, I guess.
+
+ focused_frame->Send(new InputMsg_Paste(focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("Paste"));
+}
+
RenderViewHostDelegateView* InterstitialPageImpl::GetDelegateView() {
return rvh_delegate_view_.get();
}

Powered by Google App Engine
This is Rietveld 408576698