Index: views/widget/widget_win.cc |
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc |
index f50dfbc27664a02d1afa0ca81d7e363a31e8e720..64d73ffc933b306566c575ff709a9543c61c53f4 100644 |
--- a/views/widget/widget_win.cc |
+++ b/views/widget/widget_win.cc |
@@ -1213,6 +1213,28 @@ void Widget::NotifyLocaleChanged() { |
NOTIMPLEMENTED(); |
} |
+bool Widget::ConvertRect(const Widget* source, |
+ const Widget* target, |
+ gfx::Rect* rect) { |
+ DCHECK(source); |
+ DCHECK(target); |
+ DCHECK(rect); |
+ |
+ HWND source_hwnd = source->GetNativeView(); |
+ HWND target_hwnd = target->GetNativeView(); |
+ if (source_hwnd == target_hwnd) |
+ return true; |
+ |
+ RECT win_rect = rect->ToRECT(); |
+ if (::MapWindowPoints(source_hwnd, target_hwnd, |
+ reinterpret_cast<LPPOINT>(&win_rect), |
+ sizeof(RECT)/sizeof(POINT))) { |
+ *rect = win_rect; |
+ return true; |
+ } |
+ return false; |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// NativeWidget, public: |