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

Side by Side Diff: base/sys_info_mac.cc

Issue 7065041: Fix OperatingSystemName and OperatingSystemVersion on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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
« no previous file with comments | « no previous file | base/sys_info_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include <ApplicationServices/ApplicationServices.h> 7 #include <ApplicationServices/ApplicationServices.h>
8 #include <CoreServices/CoreServices.h> 8 #include <CoreServices/CoreServices.h>
9 #include <mach/mach_host.h> 9 #include <mach/mach_host.h>
10 #include <mach/mach_init.h> 10 #include <mach/mach_init.h>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/stringprintf.h"
13 14
14 namespace base { 15 namespace base {
15 16
16 // static 17 // static
18 std::string SysInfo::OperatingSystemName() {
19 return "Mac OS X";
20 }
21
22 // static
23 std::string SysInfo::OperatingSystemVersion() {
24 int32 major, minor, bugfix;
25 OperatingSystemVersionNumbers(&major, &minor, &bugfix);
26 return base::StringPrintf("%d.%d.%d", major, minor, bugfix);
27 }
28
29 // static
17 void SysInfo::OperatingSystemVersionNumbers(int32* major_version, 30 void SysInfo::OperatingSystemVersionNumbers(int32* major_version,
18 int32* minor_version, 31 int32* minor_version,
19 int32* bugfix_version) { 32 int32* bugfix_version) {
20 Gestalt(gestaltSystemVersionMajor, 33 Gestalt(gestaltSystemVersionMajor,
21 reinterpret_cast<SInt32*>(major_version)); 34 reinterpret_cast<SInt32*>(major_version));
22 Gestalt(gestaltSystemVersionMinor, 35 Gestalt(gestaltSystemVersionMinor,
23 reinterpret_cast<SInt32*>(minor_version)); 36 reinterpret_cast<SInt32*>(minor_version));
24 Gestalt(gestaltSystemVersionBugFix, 37 Gestalt(gestaltSystemVersionBugFix,
25 reinterpret_cast<SInt32*>(bugfix_version)); 38 reinterpret_cast<SInt32*>(bugfix_version));
26 } 39 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // The primary display in a mirrored set will be counted, but those that 93 // The primary display in a mirrored set will be counted, but those that
81 // mirror it will not be. 94 // mirror it will not be.
82 ++display_count; 95 ++display_count;
83 } 96 }
84 } 97 }
85 98
86 return display_count; 99 return display_count;
87 } 100 }
88 101
89 } // namespace base 102 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/sys_info_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698