diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-14 18:18:38 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-14 18:18:38 +0000 |
commit | ba64e2bae9b1d00777a81231148e0f69909a840c (patch) | |
tree | 8d8168983abb8635bfd5e9471169febbc397d3f4 /printing/pdf_metafile_cg_mac.cc | |
parent | 7bf10b0e47e51d9c6d0a5f39a9d0bfad1d78eef4 (diff) | |
download | chromium_src-ba64e2bae9b1d00777a81231148e0f69909a840c.zip chromium_src-ba64e2bae9b1d00777a81231148e0f69909a840c.tar.gz chromium_src-ba64e2bae9b1d00777a81231148e0f69909a840c.tar.bz2 |
Improve and unify Mac OS X run-time version checks.
Don't use base::SysInfo::OperatingSystemVersionNumbers, because it calls
Gestalt, which has a few bad properties. Introduce new functions that perform
specific version checks.
BUG=85972
TEST=base_unittests MacUtilTest.IsOSEllipsis
Review URL: http://codereview.chromium.org/7144007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89028 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/pdf_metafile_cg_mac.cc')
-rw-r--r-- | printing/pdf_metafile_cg_mac.cc | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/printing/pdf_metafile_cg_mac.cc b/printing/pdf_metafile_cg_mac.cc index 4668b2d..994f58f 100644 --- a/printing/pdf_metafile_cg_mac.cc +++ b/printing/pdf_metafile_cg_mac.cc @@ -6,8 +6,8 @@ #include "base/file_path.h" #include "base/logging.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" -#include "base/sys_info.h" #include "base/sys_string_conversions.h" #include "base/threading/thread_local.h" #include "ui/gfx/rect.h" @@ -36,17 +36,6 @@ namespace { base::ThreadLocalPointer<struct __CFSet> thread_pdf_docs; -bool PDFBugFixed() { - int32 major_version; - int32 minor_version; - int32 bugfix_version; - base::SysInfo::OperatingSystemVersionNumbers(&major_version, - &minor_version, - &bugfix_version); - return - major_version > 10 || (major_version == 10 && minor_version >= 7); -} - } // namespace namespace printing { @@ -54,8 +43,7 @@ namespace printing { PdfMetafileCg::PdfMetafileCg() : page_is_open_(false), thread_pdf_docs_owned_(false) { - static bool bug_fixed = PDFBugFixed(); - if (!thread_pdf_docs.Get() && !bug_fixed) { + if (!thread_pdf_docs.Get() && base::mac::IsOSSnowLeopardOrEarlier()) { thread_pdf_docs_owned_ = true; thread_pdf_docs.Set(CFSetCreateMutable(kCFAllocatorDefault, 0, |