Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: chrome/common/env_util.cc

Issue 4079: Porting refactoring changes:... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698