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

Unified Diff: chrome/browser/renderer_host/resource_message_filter_mac.mm

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_mac.mm
diff --git a/chrome/browser/renderer_host/resource_message_filter_mac.mm b/chrome/browser/renderer_host/resource_message_filter_mac.mm
deleted file mode 100644
index 81ad8145bd949da316dee80ed228ab855e3cc0e6..0000000000000000000000000000000000000000
--- a/chrome/browser/renderer_host/resource_message_filter_mac.mm
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/renderer_host/resource_message_filter.h"
-#include "chrome/common/render_messages.h"
-
-#import <Cocoa/Cocoa.h>
-
-namespace {
-
-// Adjusts an NSRect in screen coordinates to have an origin in the upper left,
-// and stuffs it into a gfx::Rect. This is likely incorrect for a multiple-
-// monitor setup.
-gfx::Rect NSRectToRect(const NSRect rect, NSScreen* screen) {
- gfx::Rect new_rect(NSRectToCGRect(rect));
- new_rect.set_y([screen frame].size.height - new_rect.y() - new_rect.height());
- return new_rect;
-}
-
-}
-
-// We get null window_ids passed into the two functions below; please see
-// http://crbug.com/9060 for more details.
-
-void ResourceMessageFilter::OnGetWindowRect(gfx::NativeViewId window_id,
- IPC::Message* reply_msg) {
- NSView* view = gfx::NativeViewFromId(window_id);
- gfx::Rect rect;
-
- if (view && [view window]) {
- NSRect bounds = [view bounds];
- bounds = [view convertRect:bounds toView:nil];
- bounds.origin = [[view window] convertBaseToScreen:bounds.origin];
- rect = NSRectToRect(bounds, [[view window] screen]);
- }
-
- ViewHostMsg_GetWindowRect::WriteReplyParams(reply_msg, rect);
- Send(reply_msg);
-}
-
-void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id,
- IPC::Message* reply_msg) {
- NSView* view = gfx::NativeViewFromId(window_id);
- gfx::Rect rect;
-
- if (view && [view window]) {
- NSRect bounds = [[view window] frame];
- rect = NSRectToRect(bounds, [[view window] screen]);
- }
-
- ViewHostMsg_GetRootWindowRect::WriteReplyParams(reply_msg, rect);
- Send(reply_msg);
-}
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.cc ('k') | chrome/browser/renderer_host/resource_message_filter_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698