summaryrefslogtreecommitdiffstats
path: root/base/file_version_info_mac.mm
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 17:33:52 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 17:33:52 +0000
commit1265917f0c7b19bb242e21111032fb4f35b3767a (patch)
tree999c4397962987f16d9d20fd4e76f31ae52d397c /base/file_version_info_mac.mm
parent5513ee8e5373a2e7e52d2ec32ce2b608d6ac1415 (diff)
downloadchromium_src-1265917f0c7b19bb242e21111032fb4f35b3767a.zip
chromium_src-1265917f0c7b19bb242e21111032fb4f35b3767a.tar.gz
chromium_src-1265917f0c7b19bb242e21111032fb4f35b3767a.tar.bz2
I accidentally committed file_version_info. Since comments were relatively minor, I created a new CL rather than reverting the old one.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_version_info_mac.mm')
-rw-r--r--base/file_version_info_mac.mm29
1 files changed, 15 insertions, 14 deletions
diff --git a/base/file_version_info_mac.mm b/base/file_version_info_mac.mm
index a3e3e0c..23d84db 100644
--- a/base/file_version_info_mac.mm
+++ b/base/file_version_info_mac.mm
@@ -28,37 +28,39 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Copied from base/basictypes.h with some modifications
-#import <Cocoa/Cocoa.h>
-
#include "base/file_version_info.h"
+#import <Cocoa/Cocoa.h>
+
#include "base/logging.h"
#include "base/string_util.h"
-FileVersionInfo::FileVersionInfo(const std::wstring& file_path, NSBundle *bundle)
- : file_path_(file_path), bundle_(bundle) {
- if (!bundle_) {
- NSString* path = [[NSString alloc]
- initWithCString:reinterpret_cast<const char*>(file_path_.c_str())
- encoding:NSUTF32StringEncoding];
- bundle_ = [NSBundle bundleWithPath: path];
- }
+FileVersionInfo::FileVersionInfo(const std::wstring& file_path) {
+ NSString* path = [[NSString alloc]
+ initWithCString:reinterpret_cast<const char*>(file_path.c_str())
+ encoding:NSUTF32StringEncoding];
+ bundle_ = [NSBundle bundleWithPath: path];
}
-FileVersionInfo::~FileVersionInfo() {
+FileVersionInfo::FileVersionInfo(NSBundle *bundle) : bundle_(bundle) {
+}
+FileVersionInfo::~FileVersionInfo() {
+ [bundle_ release];
}
// static
FileVersionInfo* FileVersionInfo::CreateFileVersionInfoForCurrentModule() {
+ // TODO(erikkay): this should really use bundleForClass, but we don't have
+ // a class to hang onto yet.
NSBundle* bundle = [NSBundle mainBundle];
- return new FileVersionInfo(L"", bundle);
+ return new FileVersionInfo(bundle);
}
// static
FileVersionInfo* FileVersionInfo::CreateFileVersionInfo(
const std::wstring& file_path) {
- return new FileVersionInfo(file_path, nil);
+ return new FileVersionInfo(file_path);
}
std::wstring FileVersionInfo::company_name() {
@@ -126,7 +128,6 @@ bool FileVersionInfo::is_official_build() {
}
bool FileVersionInfo::GetValue(const wchar_t* name, std::wstring* value_str) {
- std::wstring str;
if (bundle_) {
NSString* value = [bundle_ objectForInfoDictionaryKey:
[NSString stringWithUTF8String:WideToUTF8(name).c_str()]];