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

Unified Diff: content/browser/frame_host/interstitial_page_impl.cc

Issue 1133003003: Fix copying from interstitial pages on OSX by going through the RenderWidgetHostDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement other OS operations. Created 5 years, 7 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 455ac74ebe69af1b12b14baa007d0263557c2beb..7b9e249a128a420bc4de7a64f68ae6282a8b192a 100644
--- a/content/browser/frame_host/interstitial_page_impl.cc
+++ b/content/browser/frame_host/interstitial_page_impl.cc
@@ -27,6 +27,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"
@@ -190,6 +191,90 @@ InterstitialPageImpl::InterstitialPageImpl(
InterstitialPageImpl::~InterstitialPageImpl() {
}
+void InterstitialPageImpl::Undo() {
+ RenderFrameHostImpl* focused_frame =
+ frame_tree_.GetFocusedFrame()->current_frame_host();
+ if (!focused_frame)
+ return;
+
+ focused_frame->Send(new InputMsg_Undo(focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("Undo"));
+}
+
+void InterstitialPageImpl::Redo() {
+ RenderFrameHostImpl* focused_frame =
+ frame_tree_.GetFocusedFrame()->current_frame_host();
+ if (!focused_frame)
+ return;
+ focused_frame->Send(new InputMsg_Redo(focused_frame->GetRoutingID()));
nasko 2015/05/13 17:24:08 Incorrect indentation. In general, you can use "gi
lgarron 2015/05/13 21:58:40 Done. (Not sure how that happened. In any case, I
+ RecordAction(base::UserMetricsAction("Redo"));
+}
+
+void InterstitialPageImpl::Cut() {
+ RenderFrameHostImpl* focused_frame =
+ frame_tree_.GetFocusedFrame()->current_frame_host();
+ if (!focused_frame)
+ return;
+
+ focused_frame->Send(new InputMsg_Cut(focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("Cut"));
+}
+
+void InterstitialPageImpl::Copy() {
+ RenderFrameHostImpl* focused_frame =
+ frame_tree_.GetFocusedFrame()->current_frame_host();
+ if (!focused_frame)
+ return;
+
+ focused_frame->Send(new InputMsg_Copy(focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("Copy"));
+}
+
+void InterstitialPageImpl::CopyToFindPboard() {
+#if defined(OS_MACOSX)
+ RenderFrameHostImpl* focused_frame =
+ frame_tree_.GetFocusedFrame()->current_frame_host();
+ if (!focused_frame)
+ return;
+
+ // Windows/Linux don't have the concept of a find pasteboard.
+ focused_frame->Send(
+ new InputMsg_CopyToFindPboard(focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("CopyToFindPboard"));
+#endif
+}
+
+void InterstitialPageImpl::Paste() {
+ RenderFrameHostImpl* focused_frame =
+ frame_tree_.GetFocusedFrame()->current_frame_host();
+ if (!focused_frame)
+ return;
+
+ focused_frame->Send(new InputMsg_Paste(focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("Paste"));
+}
+
+void InterstitialPageImpl::PasteAndMatchStyle() {
+ RenderFrameHostImpl* focused_frame =
+ frame_tree_.GetFocusedFrame()->current_frame_host();
+ if (!focused_frame)
+ return;
+
+ focused_frame->Send(new InputMsg_PasteAndMatchStyle(
+ focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("PasteAndMatchStyle"));
+}
+
+void InterstitialPageImpl::SelectAll() {
+ RenderFrameHostImpl* focused_frame =
+ frame_tree_.GetFocusedFrame()->current_frame_host();
+ if (!focused_frame)
+ return;
+
+ focused_frame->Send(new InputMsg_SelectAll(focused_frame->GetRoutingID()));
+ RecordAction(base::UserMetricsAction("SelectAll"));
+}
+
void InterstitialPageImpl::Show() {
if (!enabled())
return;

Powered by Google App Engine
This is Rietveld 408576698