Commit 89949e66 authored by noel's avatar noel Committed by Commit bot

Define ViewMsg_ColorProfile and plumb it into RenderWidget

Define ViewMsg_ColorProfile IPC message and plumb it into renderer
RenderWidget::SetDeviceColorProfile(). The browser uses the IPC to
set the renderers screen color profile.

Note SetDeviceColorProfile is overridden by RenderViewImpl, so the
IPC message data is handled there - it calls the base RenderWidget
SetDeviceColorProfile, which detects if the color profile changed,
and stores it in the RenderWidget if so.

If there was a change, the RenderViewImpl informs its webview() so
the Page contained therein can update / repaint all color profiled
elements on the Page.

For a diagram of the IPC and procedure call proceedings, including
layout test support (added in issue 369787), see:

  https://crbug.com/368663#c14

Not used as yet: the IPC from the browser-side will be added later
(need to resolve issue 338130, issue 357443 first), so this change
is again just plumbing.

CQ_EXTRA_TRYBOTS=tryserver.blink:mac_blink_rel,mac_blink_dbg
BUG=368663

Review URL: https://codereview.chromium.org/601273002

Cr-Commit-Position: refs/heads/master@{#297328}
parent 70af9b58
......@@ -581,6 +581,11 @@ IPC_STRUCT_END()
IPC_MESSAGE_ROUTED1(ViewMsg_Resize,
ViewMsg_Resize_Params /* params */)
// Sent to inform the renderer of its screen device color profile. An empty
// profile tells the renderer use the default sRGB color profile.
IPC_MESSAGE_ROUTED1(ViewMsg_ColorProfile,
std::vector<char> /* color profile */)
// Tells the render view that the resize rect has changed.
IPC_MESSAGE_ROUTED1(ViewMsg_ChangeResizeRect,
gfx::Rect /* resizer_rect */)
......
......@@ -608,6 +608,7 @@ bool RenderWidget::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose)
IPC_MESSAGE_HANDLER(ViewMsg_CreatingNew_ACK, OnCreatingNewAck)
IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize)
IPC_MESSAGE_HANDLER(ViewMsg_ColorProfile, OnColorProfile)
IPC_MESSAGE_HANDLER(ViewMsg_ChangeResizeRect, OnChangeResizeRect)
IPC_MESSAGE_HANDLER(ViewMsg_WasHidden, OnWasHidden)
IPC_MESSAGE_HANDLER(ViewMsg_WasShown, OnWasShown)
......@@ -781,6 +782,10 @@ void RenderWidget::OnResize(const ViewMsg_Resize_Params& params) {
OnOrientationChange();
}
void RenderWidget::OnColorProfile(const std::vector<char>& color_profile) {
SetDeviceColorProfile(color_profile);
}
void RenderWidget::OnChangeResizeRect(const gfx::Rect& resizer_rect) {
if (resizer_rect_ == resizer_rect)
return;
......
......@@ -373,6 +373,7 @@ class CONTENT_EXPORT RenderWidget
virtual void OnClose();
void OnCreatingNewAck();
virtual void OnResize(const ViewMsg_Resize_Params& params);
void OnColorProfile(const std::vector<char>& color_profile);
void OnChangeResizeRect(const gfx::Rect& resizer_rect);
virtual void OnWasHidden();
virtual void OnWasShown(bool needs_repainting,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment