Skip to content

Commit

Permalink
Create widget_messages.h and rename relevant View{Host}Msgs.
Browse files Browse the repository at this point in the history
This should be purely renames with no functionality changes.

Bug: 545684
Change-Id: I6bffef6e07fdf6e787f60050447047854b961cc3
Reviewed-on: https://chromium-review.googlesource.com/1220709
Reviewed-by: Dmitry Gozman <[email protected]>
Reviewed-by: Martin Barbella <[email protected]>
Reviewed-by: danakj <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Commit-Queue: Albert J. Wong <[email protected]>
Cr-Commit-Position: refs/heads/master@{#594766}
  • Loading branch information
awong-chromium authored and Commit Bot committed Sep 27, 2018
1 parent 7c58d16 commit 3c93c18
Show file tree
Hide file tree
Showing 48 changed files with 666 additions and 575 deletions.
13 changes: 7 additions & 6 deletions content/browser/browser_plugin/browser_plugin_guest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "content/common/input/ime_text_span_conversions.h"
#include "content/common/text_input_state.h"
#include "content/common/view_messages.h"
#include "content/common/widget_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_plugin_guest_manager.h"
#include "content/public/browser/content_browser_client.h"
Expand Down Expand Up @@ -716,12 +717,12 @@ bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuest, message)
IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers,
OnHasTouchEventHandlers)
IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse)
IPC_MESSAGE_HANDLER(WidgetHostMsg_LockMouse, OnLockMouse)
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget)
IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged,
IPC_MESSAGE_HANDLER(WidgetHostMsg_TextInputStateChanged,
OnTextInputStateChanged)
IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse)
IPC_MESSAGE_HANDLER(WidgetHostMsg_UnlockMouse, OnUnlockMouse)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
Expand Down Expand Up @@ -945,7 +946,7 @@ void BrowserPluginGuest::OnLockMouse(bool user_gesture,
RenderWidgetHost* widget_host =
web_contents()->GetRenderViewHost()->GetWidget();
widget_host->Send(
new ViewMsg_LockMouse_ACK(widget_host->GetRoutingID(), false));
new WidgetMsg_LockMouse_ACK(widget_host->GetRoutingID(), false));
return;
}

Expand All @@ -966,7 +967,7 @@ void BrowserPluginGuest::OnLockMouseAck(int browser_plugin_instance_id,
RenderWidgetHost* widget_host =
web_contents()->GetRenderViewHost()->GetWidget();
widget_host->Send(
new ViewMsg_LockMouse_ACK(widget_host->GetRoutingID(), succeeded));
new WidgetMsg_LockMouse_ACK(widget_host->GetRoutingID(), succeeded));
pending_lock_request_ = false;
if (succeeded)
mouse_locked_ = true;
Expand Down Expand Up @@ -1020,7 +1021,7 @@ void BrowserPluginGuest::OnUnlockMouseAck(int browser_plugin_instance_id) {
if (mouse_locked_) {
RenderWidgetHost* widget_host =
web_contents()->GetRenderViewHost()->GetWidget();
widget_host->Send(new ViewMsg_MouseLockLost(widget_host->GetRoutingID()));
widget_host->Send(new WidgetMsg_MouseLockLost(widget_host->GetRoutingID()));
}
mouse_locked_ = false;
}
Expand Down
10 changes: 5 additions & 5 deletions content/browser/devtools/protocol/emulation_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "content/browser/renderer_host/input/touch_emulator.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h"
#include "content/common/widget_messages.h"
#include "content/public/common/url_constants.h"
#include "net/http/http_util.h"
#include "services/device/public/cpp/geolocation/geoposition.h"
Expand Down Expand Up @@ -391,14 +391,14 @@ void EmulationHandler::UpdateDeviceEmulationState() {
// emulation params were applied. That way, we can avoid having to handle
// Set/ClearDeviceMetricsOverride in the renderer. With the old IPC system,
// this is tricky since we'd have to track the DevTools message id with the
// ViewMsg and acknowledgment, as well as plump the acknowledgment back to the
// EmulationHandler somehow. Mojo callbacks should make this much simpler.
// WidgetMsg and acknowledgment, as well as plump the acknowledgment back to
// the EmulationHandler somehow. Mojo callbacks should make this much simpler.
if (device_emulation_enabled_) {
host_->GetRenderWidgetHost()->Send(new ViewMsg_EnableDeviceEmulation(
host_->GetRenderWidgetHost()->Send(new WidgetMsg_EnableDeviceEmulation(
host_->GetRenderWidgetHost()->GetRoutingID(),
device_emulation_params_));
} else {
host_->GetRenderWidgetHost()->Send(new ViewMsg_DisableDeviceEmulation(
host_->GetRenderWidgetHost()->Send(new WidgetMsg_DisableDeviceEmulation(
host_->GetRenderWidgetHost()->GetRoutingID()));
}
}
Expand Down
5 changes: 3 additions & 2 deletions content/browser/devtools/protocol/page_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/web_contents/web_contents_view.h"
#include "content/common/view_messages.h"
#include "content/common/widget_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
Expand Down Expand Up @@ -789,7 +789,8 @@ Response PageHandler::StartScreencast(Maybe<std::string> format,
if (has_compositor_frame_metadata_) {
InnerSwapCompositorFrame();
} else {
widget_host->Send(new ViewMsg_ForceRedraw(widget_host->GetRoutingID(), 0));
widget_host->Send(
new WidgetMsg_ForceRedraw(widget_host->GetRoutingID(), 0));
}
return Response::FallThrough();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ class ExecuteScriptBeforeRenderFrameDeletedHelper
//
// Note that if the second WebContents scheduled a call to window.close() to
// close itself after it calls window.open(), the CreateNewWindow sync IPC could
// be dispatched *before* ViewHostMsg_Close in the browser process, provided
// be dispatched *before* WidgetHostMsg_Close in the browser process, provided
// that the browser happened to be in IPC::SyncChannel::WaitForReply on the UI
// thread (most likely after sending GpuCommandBufferMsg_* messages), in which
// case incoming sync IPCs to this thread are dispatched, but the message loop
Expand Down
9 changes: 5 additions & 4 deletions content/browser/frame_host/render_widget_host_view_guest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/common/frame_messages.h"
#include "content/common/input/web_touch_event_traits.h"
#include "content/common/view_messages.h"
#include "content/common/text_input_state.h"
#include "content/common/widget_messages.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/use_zoom_for_dsf_policy.h"
#include "gpu/ipc/common/gpu_messages.h"
Expand Down Expand Up @@ -445,7 +446,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewGuest::GetNativeViewAccessible() {

void RenderWidgetHostViewGuest::UpdateCursor(const WebCursor& cursor) {
// InterstitialPages are not WebContents so we cannot intercept
// ViewHostMsg_SetCursor for interstitial pages in BrowserPluginGuest.
// WidgetHostMsg_SetCursor for interstitial pages in BrowserPluginGuest.
// All guest RenderViewHosts have RenderWidgetHostViewGuests however,
// and so we will always hit this code path.
if (!guest_)
Expand Down Expand Up @@ -523,14 +524,14 @@ void RenderWidgetHostViewGuest::SelectionChanged(const base::string16& text,
}

void RenderWidgetHostViewGuest::SelectionBoundsChanged(
const ViewHostMsg_SelectionBounds_Params& params) {
const WidgetHostMsg_SelectionBounds_Params& params) {
if (!guest_)
return;

RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView();
if (!rwhv)
return;
ViewHostMsg_SelectionBounds_Params guest_params(params);
WidgetHostMsg_SelectionBounds_Params guest_params(params);
guest_params.anchor_rect.set_origin(
guest_->GetScreenCoordinates(params.anchor_rect.origin()));
guest_params.focus_rect.set_origin(
Expand Down
2 changes: 1 addition & 1 deletion content/browser/frame_host/render_widget_host_view_guest.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest
size_t offset,
const gfx::Range& range) override;
void SelectionBoundsChanged(
const ViewHostMsg_SelectionBounds_Params& params) override;
const WidgetHostMsg_SelectionBounds_Params& params) override;
void PreProcessMouseEvent(const blink::WebMouseEvent& event) override;
void PreProcessTouchEvent(const blink::WebTouchEvent& event) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#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_child_frame.h"
#include "content/common/view_messages.h"
#include "content/common/widget_messages.h"
#include "content/public/browser/touch_selection_controller_client_manager.h"
#include "content/public/common/use_zoom_for_dsf_policy.h"
#include "ui/base/clipboard/clipboard.h"
Expand Down Expand Up @@ -206,9 +206,9 @@ void TouchSelectionControllerClientChildFrame::RunContextMenu() {
gfx::PointF origin = rwhv_->TransformPointToRootCoordSpaceF(gfx::PointF());
anchor_point.Offset(-origin.x(), -origin.y());
RenderWidgetHostImpl* host = rwhv_->host();
host->Send(new ViewMsg_ShowContextMenu(host->GetRoutingID(),
ui::MENU_SOURCE_TOUCH_EDIT_MENU,
gfx::ToRoundedPoint(anchor_point)));
host->Send(new WidgetMsg_ShowContextMenu(host->GetRoutingID(),
ui::MENU_SOURCE_TOUCH_EDIT_MENU,
gfx::ToRoundedPoint(anchor_point)));

// Hide selection handles after getting rect-between-bounds from touch
// selection controller; otherwise, rect would be empty and the above
Expand Down
3 changes: 2 additions & 1 deletion content/browser/renderer_host/render_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
#include "content/common/service_manager/service_manager_connection_impl.h"
#include "content/common/service_worker/service_worker_utils.h"
#include "content/common/view_messages.h"
#include "content/common/widget_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/content_browser_client.h"
Expand Down Expand Up @@ -3299,7 +3300,7 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg)
IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction,
OnUserMetricsRecordAction)
IPC_MESSAGE_HANDLER(ViewHostMsg_Close_ACK, OnCloseACK)
IPC_MESSAGE_HANDLER(WidgetHostMsg_Close_ACK, OnCloseACK)
IPC_MESSAGE_HANDLER(AecDumpMsg_RegisterAecDumpConsumer,
OnRegisterAecDumpConsumer)
IPC_MESSAGE_HANDLER(AecDumpMsg_UnregisterAecDumpConsumer,
Expand Down
4 changes: 2 additions & 2 deletions content/browser/renderer_host/render_process_host_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Used to extend the lifetime of the sessions until the render view
// in the renderer is fully closed. This is static because its also called
// with mock hosts as input in test cases. The RenderWidget routing associated
// with the view is used as the key since the ViewMsg_Close and
// ViewHostMsg_Close_ACK logic is centered around RenderWidgets.
// with the view is used as the key since the WidgetMsg_Close and
// WidgetHostMsg_Close_ACK logic is centered around RenderWidgets.
static void ReleaseOnCloseACK(RenderProcessHost* host,
const SessionStorageNamespaceMap& sessions,
int widget_route_id);
Expand Down
11 changes: 8 additions & 3 deletions content/browser/renderer_host/render_view_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
#include "content/common/renderer.mojom.h"
#include "content/common/swapped_out_messages.h"
#include "content/common/view_messages.h"
// TODO(ajwong): Remove widget_messages.h when WidgetHostMsg_Close is moved to
// only RenderWidgetHostImpl.
#include "content/common/widget_messages.h"
#include "content/public/browser/ax_event_notification_details.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/browser_context.h"
Expand Down Expand Up @@ -792,7 +795,9 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget,
OnShowFullscreenWidget)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnUpdateTargetURL)
IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose)
// TODO:(ajwong): Move OnClose to RenderWidgetHostOwnerDelegate.
// https://crbug.com/545684
IPC_MESSAGE_HANDLER(WidgetHostMsg_Close, OnClose)
IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame,
OnDocumentAvailableInMainFrame)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange,
Expand Down Expand Up @@ -841,13 +846,13 @@ void RenderViewHostImpl::OnShowWidget(int widget_route_id,
const gfx::Rect& initial_rect) {
delegate_->ShowCreatedWidget(GetProcess()->GetID(), widget_route_id,
initial_rect);
Send(new ViewMsg_SetBounds_ACK(widget_route_id));
Send(new WidgetMsg_SetBounds_ACK(widget_route_id));
}

void RenderViewHostImpl::OnShowFullscreenWidget(int widget_route_id) {
delegate_->ShowCreatedFullscreenWidget(GetProcess()->GetID(),
widget_route_id);
Send(new ViewMsg_SetBounds_ACK(widget_route_id));
Send(new WidgetMsg_SetBounds_ACK(widget_route_id));
}

void RenderViewHostImpl::OnUpdateTargetURL(const GURL& url) {
Expand Down
Loading

0 comments on commit 3c93c18

Please sign in to comment.