| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/window/window_win.h" | 5 #include "views/window/window_win.h" |
| 6 | 6 |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 | 8 |
| 9 #include "app/gfx/canvas_paint.h" | 9 #include "app/gfx/canvas_paint.h" |
| 10 #include "app/gfx/font.h" | 10 #include "app/gfx/font.h" |
| (...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 DCHECK(succeeded); | 1364 DCHECK(succeeded); |
| 1365 | 1365 |
| 1366 if (bounds != NULL) { | 1366 if (bounds != NULL) { |
| 1367 MONITORINFO mi; | 1367 MONITORINFO mi; |
| 1368 mi.cbSize = sizeof(mi); | 1368 mi.cbSize = sizeof(mi); |
| 1369 const bool succeeded = !!GetMonitorInfo( | 1369 const bool succeeded = !!GetMonitorInfo( |
| 1370 MonitorFromWindow(GetNativeView(), MONITOR_DEFAULTTONEAREST), &mi); | 1370 MonitorFromWindow(GetNativeView(), MONITOR_DEFAULTTONEAREST), &mi); |
| 1371 DCHECK(succeeded); | 1371 DCHECK(succeeded); |
| 1372 *bounds = gfx::Rect(wp.rcNormalPosition); | 1372 *bounds = gfx::Rect(wp.rcNormalPosition); |
| 1373 // Convert normal position from workarea coordinates to screen coordinates. | 1373 // Convert normal position from workarea coordinates to screen coordinates. |
| 1374 bounds->Offset(mi.rcWork.left, mi.rcWork.top); | 1374 bounds->Offset(mi.rcWork.left - mi.rcMonitor.left, |
| 1375 mi.rcWork.top - mi.rcMonitor.top); |
| 1375 } | 1376 } |
| 1376 | 1377 |
| 1377 if (maximized != NULL) | 1378 if (maximized != NULL) |
| 1378 *maximized = (wp.showCmd == SW_SHOWMAXIMIZED); | 1379 *maximized = (wp.showCmd == SW_SHOWMAXIMIZED); |
| 1379 } | 1380 } |
| 1380 | 1381 |
| 1381 void WindowWin::InitClass() { | 1382 void WindowWin::InitClass() { |
| 1382 static bool initialized = false; | 1383 static bool initialized = false; |
| 1383 if (!initialized) { | 1384 if (!initialized) { |
| 1384 resize_cursors_[RC_NORMAL] = LoadCursor(NULL, IDC_ARROW); | 1385 resize_cursors_[RC_NORMAL] = LoadCursor(NULL, IDC_ARROW); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 } | 1417 } |
| 1417 return TRUE; | 1418 return TRUE; |
| 1418 } | 1419 } |
| 1419 } // namespace | 1420 } // namespace |
| 1420 | 1421 |
| 1421 void Window::CloseAllSecondaryWindows() { | 1422 void Window::CloseAllSecondaryWindows() { |
| 1422 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); | 1423 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); |
| 1423 } | 1424 } |
| 1424 | 1425 |
| 1425 } // namespace views | 1426 } // namespace views |
| OLD | NEW |