| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |