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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2884243003: Add a mojo channel for frame messages. (Closed)
Patch Set: Created 3 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/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 41778bf796aa7223f8ca8e384db023cb4509de19..0daa0e1a91455300d54428b41ace7a0404ef8e87 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2739,8 +2739,7 @@ void WebContentsImpl::MoveRangeSelectionExtent(const gfx::Point& extent) {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_MoveRangeSelectionExtent(
- focused_frame->GetRoutingID(), extent));
+ focused_frame->GetFrameInputHandler()->MoveRangeSelectionExtent(extent);
}
void WebContentsImpl::SelectRange(const gfx::Point& base,
@@ -2749,8 +2748,7 @@ void WebContentsImpl::SelectRange(const gfx::Point& base,
if (!focused_frame)
return;
- focused_frame->Send(
- new InputMsg_SelectRange(focused_frame->GetRoutingID(), base, extent));
+ focused_frame->GetFrameInputHandler()->SelectRange(base, extent);
}
void WebContentsImpl::AdjustSelectionByCharacterOffset(int start_adjust,
@@ -2759,8 +2757,8 @@ void WebContentsImpl::AdjustSelectionByCharacterOffset(int start_adjust,
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_AdjustSelectionByCharacterOffset(
- focused_frame->GetRoutingID(), start_adjust, end_adjust));
+ focused_frame->GetFrameInputHandler()->AdjustSelectionByCharacterOffset(
+ start_adjust, end_adjust);
}
void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) {
@@ -2920,7 +2918,7 @@ void WebContentsImpl::Undo() {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_Undo(focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->Undo();
RecordAction(base::UserMetricsAction("Undo"));
}
@@ -2928,7 +2926,7 @@ void WebContentsImpl::Redo() {
RenderFrameHost* focused_frame = GetFocusedFrame();
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_Redo(focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->Redo();
RecordAction(base::UserMetricsAction("Redo"));
}
@@ -2937,7 +2935,7 @@ void WebContentsImpl::Cut() {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_Cut(focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->Cut();
RecordAction(base::UserMetricsAction("Cut"));
}
@@ -2946,7 +2944,7 @@ void WebContentsImpl::Copy() {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_Copy(focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->Copy();
RecordAction(base::UserMetricsAction("Copy"));
}
@@ -2957,8 +2955,7 @@ void WebContentsImpl::CopyToFindPboard() {
return;
// Windows/Linux don't have the concept of a find pasteboard.
- focused_frame->Send(
- new InputMsg_CopyToFindPboard(focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->CopyToFindPboard();
RecordAction(base::UserMetricsAction("CopyToFindPboard"));
#endif
}
@@ -2968,7 +2965,7 @@ void WebContentsImpl::Paste() {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_Paste(focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->Paste();
RecordAction(base::UserMetricsAction("Paste"));
}
@@ -2977,8 +2974,7 @@ void WebContentsImpl::PasteAndMatchStyle() {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_PasteAndMatchStyle(
- focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->PasteAndMatchStyle();
RecordAction(base::UserMetricsAction("PasteAndMatchStyle"));
}
@@ -2987,7 +2983,7 @@ void WebContentsImpl::Delete() {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_Delete(focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->Delete();
RecordAction(base::UserMetricsAction("DeleteSelection"));
}
@@ -2996,7 +2992,7 @@ void WebContentsImpl::SelectAll() {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_SelectAll(focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->SelectAll();
RecordAction(base::UserMetricsAction("SelectAll"));
}
@@ -3005,8 +3001,7 @@ void WebContentsImpl::CollapseSelection() {
if (!focused_frame)
return;
- focused_frame->Send(
- new InputMsg_CollapseSelection(focused_frame->GetRoutingID()));
+ focused_frame->GetFrameInputHandler()->CollapseSelection();
}
void WebContentsImpl::Replace(const base::string16& word) {
@@ -3014,8 +3009,7 @@ void WebContentsImpl::Replace(const base::string16& word) {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_Replace(
- focused_frame->GetRoutingID(), word));
+ focused_frame->GetFrameInputHandler()->Replace(base::UTF16ToUTF8(word));
}
void WebContentsImpl::ReplaceMisspelling(const base::string16& word) {
@@ -3023,8 +3017,8 @@ void WebContentsImpl::ReplaceMisspelling(const base::string16& word) {
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_ReplaceMisspelling(
- focused_frame->GetRoutingID(), word));
+ focused_frame->GetFrameInputHandler()->ReplaceMisspelling(
+ base::UTF16ToUTF8(word));
dcheng 2017/05/17 04:49:06 Btw, should we have a bug tracking cleaning this u
dtapuska 2017/05/17 17:08:07 Changed interface to support string16 instead.
}
void WebContentsImpl::NotifyContextMenuClosed(

Powered by Google App Engine
This is Rietveld 408576698