| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/widget_win.h" | 5 #include "views/widget/widget_win.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
| (...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 WidgetWin* widget = new WidgetWin; | 1206 WidgetWin* widget = new WidgetWin; |
| 1207 widget->SetCreateParams(params); | 1207 widget->SetCreateParams(params); |
| 1208 return widget; | 1208 return widget; |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 // static | 1211 // static |
| 1212 void Widget::NotifyLocaleChanged() { | 1212 void Widget::NotifyLocaleChanged() { |
| 1213 NOTIMPLEMENTED(); | 1213 NOTIMPLEMENTED(); |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 bool Widget::ConvertRect(const Widget* source, |
| 1217 const Widget* target, |
| 1218 gfx::Rect* rect) { |
| 1219 DCHECK(source); |
| 1220 DCHECK(target); |
| 1221 DCHECK(rect); |
| 1222 |
| 1223 HWND source_hwnd = source->GetNativeView(); |
| 1224 HWND target_hwnd = target->GetNativeView(); |
| 1225 if (source_hwnd == target_hwnd) |
| 1226 return true; |
| 1227 |
| 1228 RECT win_rect = rect->ToRECT(); |
| 1229 if (::MapWindowPoints(source_hwnd, target_hwnd, |
| 1230 reinterpret_cast<LPPOINT>(&win_rect), |
| 1231 sizeof(RECT)/sizeof(POINT))) { |
| 1232 *rect = win_rect; |
| 1233 return true; |
| 1234 } |
| 1235 return false; |
| 1236 } |
| 1237 |
| 1216 //////////////////////////////////////////////////////////////////////////////// | 1238 //////////////////////////////////////////////////////////////////////////////// |
| 1217 // NativeWidget, public: | 1239 // NativeWidget, public: |
| 1218 | 1240 |
| 1219 NativeWidget* NativeWidget::GetNativeWidgetForNativeView( | 1241 NativeWidget* NativeWidget::GetNativeWidgetForNativeView( |
| 1220 gfx::NativeView native_view) { | 1242 gfx::NativeView native_view) { |
| 1221 if (!ui::WindowImpl::IsWindowImpl(native_view)) | 1243 if (!ui::WindowImpl::IsWindowImpl(native_view)) |
| 1222 return NULL; | 1244 return NULL; |
| 1223 return reinterpret_cast<WidgetWin*>( | 1245 return reinterpret_cast<WidgetWin*>( |
| 1224 ViewProp::GetValue(native_view, kNativeWidgetKey)); | 1246 ViewProp::GetValue(native_view, kNativeWidgetKey)); |
| 1225 } | 1247 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 return; | 1285 return; |
| 1264 | 1286 |
| 1265 NativeWidget* native_widget = GetNativeWidgetForNativeView(native_view); | 1287 NativeWidget* native_widget = GetNativeWidgetForNativeView(native_view); |
| 1266 if (native_widget) | 1288 if (native_widget) |
| 1267 children->insert(native_widget); | 1289 children->insert(native_widget); |
| 1268 EnumChildWindows(native_view, EnumerateChildWindowsForNativeWidgets, | 1290 EnumChildWindows(native_view, EnumerateChildWindowsForNativeWidgets, |
| 1269 reinterpret_cast<LPARAM>(children)); | 1291 reinterpret_cast<LPARAM>(children)); |
| 1270 } | 1292 } |
| 1271 | 1293 |
| 1272 } // namespace views | 1294 } // namespace views |
| OLD | NEW |