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

Unified Diff: chrome/browser/renderer_host/resource_message_filter_win.cc

Issue 151130: Wire GetWindowRect, GetRootWindowRect, and GetScreenInfo out to the UI thread. (Closed)
Patch Set: Darin's suggestions. Created 11 years, 5 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: chrome/browser/renderer_host/resource_message_filter_win.cc
diff --git a/chrome/browser/renderer_host/resource_message_filter_win.cc b/chrome/browser/renderer_host/resource_message_filter_win.cc
index 2aae6ed97857ab74a073f67a2ed36faa3ef9ef69..b9acece1966b8352fd8d66680e7e8c9f0a33e40c 100644
--- a/chrome/browser/renderer_host/resource_message_filter_win.cc
+++ b/chrome/browser/renderer_host/resource_message_filter_win.cc
@@ -4,10 +4,17 @@
#include "chrome/browser/renderer_host/resource_message_filter.h"
#include "chrome/common/render_messages.h"
+#include "webkit/api/public/win/WebScreenInfoFactory.h"
+
+using WebKit::WebScreenInfo;
+using WebKit::WebScreenInfoFactory;
// We get null window_ids passed into the two functions below; please see
// http://crbug.com/9060 for more details.
+// TODO(shess): Provide a mapping from reply_msg->routing_id() to HWND
+// so that we can eliminate the NativeViewId parameter.
+
void ResourceMessageFilter::OnGetWindowRect(gfx::NativeViewId window_id,
IPC::Message* reply_msg) {
HWND window = gfx::NativeViewFromId(window_id);
@@ -30,3 +37,11 @@ void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id,
ViewHostMsg_GetRootWindowRect::WriteReplyParams(reply_msg, rect);
Send(reply_msg);
}
+
+void ResourceMessageFilter::OnGetScreenInfo(gfx::NativeViewId view,
+ IPC::Message* reply_msg) {
+ WebScreenInfo results =
+ WebScreenInfoFactory::screenInfo(gfx::NativeViewFromId(view));
+ ViewHostMsg_GetScreenInfo::WriteReplyParams(reply_msg, results);
+ Send(reply_msg);
+}
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter_mac.mm ('k') | chrome/browser/renderer_host/test/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698