| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <string> | 5 #include <string> |
| 6 #include <list> | 6 #include <list> |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <commctrl.h> | 8 #include <commctrl.h> |
| 9 | 9 |
| 10 #include "app/gfx/native_theme_win.h" | 10 #include "app/gfx/native_theme_win.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 std::list<std::string> errors; | 45 std::list<std::string> errors; |
| 46 | 46 |
| 47 OSVERSIONINFOEX osvi; | 47 OSVERSIONINFOEX osvi; |
| 48 ::ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); | 48 ::ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); |
| 49 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); | 49 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); |
| 50 ::GetVersionEx((OSVERSIONINFO *)&osvi); | 50 ::GetVersionEx((OSVERSIONINFO *)&osvi); |
| 51 | 51 |
| 52 // default to XP metrics, override if on Vista | 52 // default to XP metrics, override if on Vista |
| 53 int requiredVScrollSize = 17; | 53 int requiredVScrollSize = 17; |
| 54 int requiredFontSize = -11; // 8 pt | 54 int requiredFontSize = -11; // 8 pt |
| 55 const WCHAR *requiredFont = L"Tahoma"; | 55 const wchar_t* requiredFont = L"Tahoma"; |
| 56 // Consider Windows 7 as Vista. |
| 56 bool isVista = false; | 57 bool isVista = false; |
| 57 if (osvi.dwMajorVersion == 6 | 58 if (osvi.dwMajorVersion == 6 |
| 58 && osvi.dwMinorVersion == 0 | 59 && (osvi.dwMinorVersion == 0 || osvi.dwMinorVersion == 1) |
| 59 && osvi.wProductType == VER_NT_WORKSTATION) { | 60 && osvi.wProductType == VER_NT_WORKSTATION) { |
| 60 requiredFont = L"Segoe UI"; | 61 requiredFont = L"Segoe UI"; |
| 61 requiredFontSize = -12; // 9 pt | 62 requiredFontSize = -12; // 9 pt |
| 62 isVista = true; | 63 isVista = true; |
| 63 } else if (osvi.dwMajorVersion == 5 | 64 } else if (osvi.dwMajorVersion == 5 |
| 64 && osvi.dwMinorVersion == 1 | 65 && osvi.dwMinorVersion == 1 |
| 65 && osvi.wProductType == VER_NT_WORKSTATION) { | 66 && osvi.wProductType == VER_NT_WORKSTATION) { |
| 66 // XP; | 67 // XP; |
| 67 } else { | 68 } else { |
| 68 errors.push_back("Unsupported Operating System version " | 69 errors.push_back("Unsupported Operating System version " |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 void TestShellPlatformDelegate::SetWindowPositionForRecording( | 142 void TestShellPlatformDelegate::SetWindowPositionForRecording( |
| 142 TestShell *shell) { | 143 TestShell *shell) { |
| 143 // Move the window to the upper left corner for consistent | 144 // Move the window to the upper left corner for consistent |
| 144 // record/playback mode. For automation, we want this to work | 145 // record/playback mode. For automation, we want this to work |
| 145 // on build systems where the script invoking us is a background | 146 // on build systems where the script invoking us is a background |
| 146 // process. So for this case, make our window the topmost window | 147 // process. So for this case, make our window the topmost window |
| 147 // as well. | 148 // as well. |
| 148 ForegroundHelper::SetForeground(shell->mainWnd()); | 149 ForegroundHelper::SetForeground(shell->mainWnd()); |
| 149 ::SetWindowPos(shell->mainWnd(), HWND_TOP, 0, 0, 600, 800, 0); | 150 ::SetWindowPos(shell->mainWnd(), HWND_TOP, 0, 0, 600, 800, 0); |
| 150 } | 151 } |
| OLD | NEW |