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

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

Issue 2884243003: Add a mojo channel for frame messages. (Closed)
Patch Set: Use WeakPtr inside FrameInputHandlerImpl, add comments 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 04fb82325bf72d4b6a47cf8c27636a383627f288..01a1c051b9606854ff7fef8465cfc0d0b3ddd2e4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2744,8 +2744,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,
@@ -2754,8 +2753,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,
@@ -2764,8 +2762,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) {
@@ -2925,7 +2923,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"));
}
@@ -2933,7 +2931,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"));
}
@@ -2942,7 +2940,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"));
}
@@ -2951,7 +2949,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"));
}
@@ -2962,8 +2960,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
}
@@ -2973,7 +2970,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"));
}
@@ -2982,8 +2979,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"));
}
@@ -2992,7 +2988,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"));
}
@@ -3001,7 +2997,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"));
}
@@ -3010,8 +3006,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) {
@@ -3019,8 +3014,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(word);
}
void WebContentsImpl::ReplaceMisspelling(const base::string16& word) {
@@ -3028,8 +3022,7 @@ 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(word);
}
void WebContentsImpl::NotifyContextMenuClosed(

Powered by Google App Engine
This is Rietveld 408576698