OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/common/env_util.h" | |
6 | |
7 #include "base/basictypes.h" | |
8 #include "base/logging.h" | |
9 | |
10 namespace env_util { | |
11 | |
12 std::string GetOperatingSystemName() { | |
13 return "Windows"; | |
14 } | |
15 | |
16 std::string GetOperatingSystemVersion() { | |
17 OSVERSIONINFO info = {0}; | |
18 info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); | |
19 GetVersionEx(&info); | |
20 | |
21 char result[20]; | |
22 memset(result, 0, arraysize(result)); | |
23 _snprintf_s(result, arraysize(result), | |
24 "%lu.%lu", info.dwMajorVersion, info.dwMinorVersion); | |
25 return std::string(result); | |
26 } | |
27 | |
28 std::string GetCPUArchitecture() { | |
29 // TODO: Make this vary when we support any other architectures. | |
30 return "x86"; | |
31 } | |
32 | |
33 void GetPrimaryDisplayDimensions(int* width, int* height) { | |
34 if (width) | |
35 *width = GetSystemMetrics(SM_CXSCREEN); | |
36 | |
37 if (height) | |
38 *height = GetSystemMetrics(SM_CYSCREEN); | |
39 } | |
40 | |
41 int GetDisplayCount() { | |
42 return GetSystemMetrics(SM_CMONITORS); | |
43 } | |
44 | |
45 } // namespace env_util | |
46 | |
OLD | NEW |