Index: views/widget/widget_win.cc |
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc |
index bd8a049ac938a060ad9541ca7748afabe0b00f85..6badb94790e8444fe8b3720faf663264d6bdf869 100644 |
--- a/views/widget/widget_win.cc |
+++ b/views/widget/widget_win.cc |
@@ -1208,6 +1208,28 @@ void Widget::NotifyLocaleChanged() { |
NOTIMPLEMENTED(); |
} |
+bool Widget::ConvertRect(const Widget* from, |
+ const Widget* to, |
+ gfx::Rect* rect) { |
+ DCHECK(from); |
+ DCHECK(to); |
+ DCHECK(rect); |
+ |
+ HWND from_hwnd = from->GetNativeView(); |
+ HWND to_hwnd = to->GetNativeView(); |
+ if (from_hwnd == to_hwnd) |
+ return true; |
+ |
+ RECT win_rect = rect->ToRECT(); |
+ if (::MapWindowPoints(from_hwnd, to_hwnd, |
+ reinterpret_cast<LPPOINT>(&win_rect), |
+ sizeof(RECT)/sizeof(POINT))) { |
+ *rect = win_rect; |
+ return true; |
+ } |
+ return false; |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// NativeWidget, public: |