OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/renderer_host/resource_message_filter.h" | 5 #include "chrome/browser/renderer_host/resource_message_filter.h" |
| 6 #include "chrome/common/render_messages.h" |
6 | 7 |
7 // We get null window_ids passed into the two functions below; please see | 8 // We get null window_ids passed into the two functions below; please see |
8 // http://crbug.com/9060 for more details. | 9 // http://crbug.com/9060 for more details. |
9 | 10 |
10 void ResourceMessageFilter::OnGetWindowRect(gfx::NativeViewId window_id, | 11 void ResourceMessageFilter::OnGetWindowRect(gfx::NativeViewId window_id, |
11 gfx::Rect* rect) { | 12 IPC::Message* reply_msg) { |
12 HWND window = gfx::NativeViewFromId(window_id); | 13 HWND window = gfx::NativeViewFromId(window_id); |
13 RECT window_rect = {0}; | 14 RECT window_rect = {0}; |
14 GetWindowRect(window, &window_rect); | 15 GetWindowRect(window, &window_rect); |
15 *rect = window_rect; | 16 gfx::Rect rect(window_rect); |
| 17 |
| 18 ViewHostMsg_GetWindowRect::WriteReplyParams(reply_msg, rect); |
| 19 Send(reply_msg); |
16 } | 20 } |
17 | 21 |
18 void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id, | 22 void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id, |
19 gfx::Rect* rect) { | 23 IPC::Message* reply_msg) { |
20 HWND window = gfx::NativeViewFromId(window_id); | 24 HWND window = gfx::NativeViewFromId(window_id); |
21 RECT window_rect = {0}; | 25 RECT window_rect = {0}; |
22 HWND root_window = ::GetAncestor(window, GA_ROOT); | 26 HWND root_window = ::GetAncestor(window, GA_ROOT); |
23 GetWindowRect(root_window, &window_rect); | 27 GetWindowRect(root_window, &window_rect); |
24 *rect = window_rect; | 28 gfx::Rect rect(window_rect); |
| 29 |
| 30 ViewHostMsg_GetRootWindowRect::WriteReplyParams(reply_msg, rect); |
| 31 Send(reply_msg); |
25 } | 32 } |
OLD | NEW |