| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef BASE_FILE_VERSION_INFO_MAC_H_ | 5 #ifndef BASE_FILE_VERSION_INFO_MAC_H_ |
| 6 #define BASE_FILE_VERSION_INFO_MAC_H_ | 6 #define BASE_FILE_VERSION_INFO_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/file_version_info.h" | 11 #include "base/file_version_info.h" |
| 13 #include "base/scoped_ptr.h" | 12 #include "base/scoped_nsobject.h" |
| 14 | 13 |
| 15 #ifdef __OBJC__ | 14 #ifdef __OBJC__ |
| 16 @class NSBundle; | 15 @class NSBundle; |
| 17 #else | 16 #else |
| 18 class NSBundle; | 17 class NSBundle; |
| 19 #endif | 18 #endif |
| 20 | 19 |
| 21 // Provides a way to access the version information for a file. | 20 // Provides a way to access the version information for a file. |
| 22 // This is the information you access when you select a file in the Windows | 21 // This is the information you access when you select a file in the Windows |
| 23 // explorer, right-click select Properties, then click the Version tab. | 22 // explorer, right-click select Properties, then click the Version tab. |
| 24 | 23 |
| 25 class FileVersionInfoMac : public FileVersionInfo { | 24 class FileVersionInfoMac : public FileVersionInfo { |
| 26 public: | 25 public: |
| 27 explicit FileVersionInfoMac(NSBundle *bundle); | 26 explicit FileVersionInfoMac(NSBundle *bundle); |
| 28 ~FileVersionInfoMac(); | |
| 29 | 27 |
| 30 // Accessors to the different version properties. | 28 // Accessors to the different version properties. |
| 31 // Returns an empty string if the property is not found. | 29 // Returns an empty string if the property is not found. |
| 32 virtual std::wstring company_name(); | 30 virtual std::wstring company_name(); |
| 33 virtual std::wstring company_short_name(); | 31 virtual std::wstring company_short_name(); |
| 34 virtual std::wstring product_name(); | 32 virtual std::wstring product_name(); |
| 35 virtual std::wstring product_short_name(); | 33 virtual std::wstring product_short_name(); |
| 36 virtual std::wstring internal_name(); | 34 virtual std::wstring internal_name(); |
| 37 virtual std::wstring product_version(); | 35 virtual std::wstring product_version(); |
| 38 virtual std::wstring private_build(); | 36 virtual std::wstring private_build(); |
| 39 virtual std::wstring special_build(); | 37 virtual std::wstring special_build(); |
| 40 virtual std::wstring comments(); | 38 virtual std::wstring comments(); |
| 41 virtual std::wstring original_filename(); | 39 virtual std::wstring original_filename(); |
| 42 virtual std::wstring file_description(); | 40 virtual std::wstring file_description(); |
| 43 virtual std::wstring file_version(); | 41 virtual std::wstring file_version(); |
| 44 virtual std::wstring legal_copyright(); | 42 virtual std::wstring legal_copyright(); |
| 45 virtual std::wstring legal_trademarks(); | 43 virtual std::wstring legal_trademarks(); |
| 46 virtual std::wstring last_change(); | 44 virtual std::wstring last_change(); |
| 47 virtual bool is_official_build(); | 45 virtual bool is_official_build(); |
| 48 | 46 |
| 49 private: | 47 private: |
| 50 // Lets you access other properties not covered above. | 48 // Lets you access other properties not covered above. |
| 51 bool GetValue(const wchar_t* name, std::wstring* value); | 49 bool GetValue(const wchar_t* name, std::wstring* value); |
| 52 | 50 |
| 53 // Similar to GetValue but returns a wstring (empty string if the property | 51 // Similar to GetValue but returns a wstring (empty string if the property |
| 54 // does not exist). | 52 // does not exist). |
| 55 std::wstring GetStringValue(const wchar_t* name); | 53 std::wstring GetStringValue(const wchar_t* name); |
| 56 | 54 |
| 57 NSBundle *bundle_; | 55 scoped_nsobject<NSBundle> bundle_; |
| 58 | 56 |
| 59 DISALLOW_COPY_AND_ASSIGN(FileVersionInfoMac); | 57 DISALLOW_COPY_AND_ASSIGN(FileVersionInfoMac); |
| 60 }; | 58 }; |
| 61 | 59 |
| 62 #endif // BASE_FILE_VERSION_INFO_MAC_H_ | 60 #endif // BASE_FILE_VERSION_INFO_MAC_H_ |
| OLD | NEW |