Chromium Code Reviews| Index: content/browser/renderer_host/render_message_filter.cc |
| diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc |
| index 0dfb42e886f7364325da21efb5a685b5478300d9..8a23d06acec4f30c47ec609d3bc8c7a42190777a 100644 |
| --- a/content/browser/renderer_host/render_message_filter.cc |
| +++ b/content/browser/renderer_host/render_message_filter.cc |
| @@ -55,6 +55,7 @@ |
| #include "net/url_request/url_request_context.h" |
| #include "net/url_request/url_request_context_getter.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresenter.h" |
| +#include "ui/gfx/color_profile.h" |
| #include "webkit/glue/webcookie.h" |
| #include "webkit/glue/webkit_glue.h" |
| #include "webkit/plugins/npapi/plugin_group.h" |
| @@ -301,6 +302,15 @@ RenderMessageFilter::~RenderMessageFilter() { |
| DCHECK(plugin_host_clients_.empty()); |
| } |
| +void RenderMessageFilter::OverrideThreadForMessage( |
| + const IPC::Message& message, BrowserThread::ID* thread) { |
| +#if defined(OS_WIN) |
| + // Windows monitor profile must be read from a file. |
| + if (message.type() == ViewHostMsg_GetMonitorColorProfile::ID) |
| + *thread = BrowserThread::FILE; |
| +#endif |
| +} |
| + |
| void RenderMessageFilter::OnChannelClosing() { |
| BrowserMessageFilter::OnChannelClosing(); |
| for (std::set<OpenChannelToNpapiPluginCallback*>::iterator it = |
| @@ -390,6 +400,8 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message, |
| OnGetHardwareSampleRate) |
| IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputChannelLayout, |
| OnGetHardwareInputChannelLayout) |
| + IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetMonitorColorProfile, |
| + OnGetMonitorColorProfile) |
| IPC_MESSAGE_HANDLER(ViewHostMsg_MediaLogEvent, OnMediaLogEvent) |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP_EX() |
| @@ -708,6 +720,16 @@ void RenderMessageFilter::OnGetHardwareInputChannelLayout( |
| media::AudioManagerBase::kDefaultDeviceId); |
| } |
| +void RenderMessageFilter::OnGetMonitorColorProfile( |
| + gfx::NativeViewId parent_hwnd, |
|
Evan Stade
2012/06/12 00:48:24
hwnd... ew. Please call it something platform-agno
tpayne
2012/06/19 17:51:15
Done.
|
| + std::string type, |
| + IPC::Message* reply_msg) { |
| + std::vector<char> profile; |
| + gfx::ColorProfile::GetColorProfile(parent_hwnd, &profile); |
|
tony
2012/06/14 22:56:36
We probably want to cache this in the browser proc
tpayne
2012/06/14 23:05:04
I do, one level down (in gfx::ColorProfile::GetCol
|
| + ViewHostMsg_GetMonitorColorProfile::WriteReplyParams(reply_msg, profile); |
| + Send(reply_msg); |
| +} |
| + |
| void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message, |
| const GURL& url, |
| const content::Referrer& referrer, |