diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-05 20:00:26 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-05 20:00:26 +0000 |
commit | 72c93c7075cc4b68c3e013be1aeeb3d0c9671873 (patch) | |
tree | 2a81dc0c2a3f5c9990c093d65be3b24b6f6cde5f /base | |
parent | d39b49d06ce5055480d4983becb653a43f39ebf2 (diff) | |
download | chromium_src-72c93c7075cc4b68c3e013be1aeeb3d0c9671873.zip chromium_src-72c93c7075cc4b68c3e013be1aeeb3d0c9671873.tar.gz chromium_src-72c93c7075cc4b68c3e013be1aeeb3d0c9671873.tar.bz2 |
Bring over the changes from the Mac branch.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/file_version_info.h | 17 | ||||
-rw-r--r-- | base/file_version_info_unittest.cc | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/base/file_version_info.h b/base/file_version_info.h index 8d82e87..94b3955 100644 --- a/base/file_version_info.h +++ b/base/file_version_info.h @@ -35,6 +35,14 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" +#ifdef OS_MACOSX +#ifdef __OBJC__ +@class NSBundle; +#else +class NSBundle; +#endif +#endif + // Provides a way to access the version information for a file. // This is the information you access when you select a file in the Windows // explorer, right-click select Properties, then click the Version tab. @@ -79,10 +87,13 @@ class FileVersionInfo { // does not exist). std::wstring GetStringValue(const wchar_t* name); +#ifdef OS_WIN // Get the fixed file info if it exists. Otherwise NULL VS_FIXEDFILEINFO* fixed_file_info() { return fixed_file_info_; } +#endif private: +#if defined(OS_WIN) FileVersionInfo(void* data, int language, int code_page); scoped_ptr_malloc<char> data_; @@ -90,6 +101,12 @@ class FileVersionInfo { int code_page_; // This is a pointer into the data_ if it exists. Otherwise NULL. VS_FIXEDFILEINFO* fixed_file_info_; +#elif defined(OS_MACOSX) + FileVersionInfo(const std::wstring& file_path, NSBundle *bundle); + + const std::wstring& file_path_; + NSBundle *bundle_; +#endif DISALLOW_EVIL_CONSTRUCTORS(FileVersionInfo); }; diff --git a/base/file_version_info_unittest.cc b/base/file_version_info_unittest.cc index 272cba8f..a7c13cf 100644 --- a/base/file_version_info_unittest.cc +++ b/base/file_version_info_unittest.cc @@ -49,6 +49,7 @@ std::wstring GetTestDataPath() { } +#ifdef OS_WIN TEST(FileVersionInfoTest, HardCodedProperties) { const wchar_t* kDLLNames[] = { L"FileVersionInfoTest1.dll" @@ -99,7 +100,9 @@ TEST(FileVersionInfoTest, HardCodedProperties) { EXPECT_EQ(kExpectedValues[i][j++], version_info->last_change()); } } +#endif +#ifdef OS_WIN TEST(FileVersionInfoTest, IsOfficialBuild) { const wchar_t* kDLLNames[] = { L"FileVersionInfoTest1.dll", @@ -124,6 +127,7 @@ TEST(FileVersionInfoTest, IsOfficialBuild) { EXPECT_EQ(kExpected[i], version_info->is_official_build()); } } +#endif TEST(FileVersionInfoTest, CustomProperties) { std::wstring dll_path = GetTestDataPath(); @@ -134,6 +138,7 @@ TEST(FileVersionInfoTest, CustomProperties) { // Test few existing properties. std::wstring str; +#ifdef OS_WIN EXPECT_TRUE(version_info->GetValue(L"Custom prop 1", &str)); EXPECT_EQ(L"Un", str); EXPECT_EQ(L"Un", version_info->GetStringValue(L"Custom prop 1")); @@ -146,6 +151,7 @@ TEST(FileVersionInfoTest, CustomProperties) { EXPECT_EQ(L"1600 Amphitheatre Parkway Mountain View, CA 94043", str); EXPECT_EQ(L"1600 Amphitheatre Parkway Mountain View, CA 94043", version_info->GetStringValue(L"Custom prop 3")); +#endif // Test an non-existing property. EXPECT_FALSE(version_info->GetValue(L"Unknown property", &str)); |