summaryrefslogtreecommitdiffstats
path: root/chrome/app
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/app')
-rw-r--r--chrome/app/chrome_version_info.cc52
-rw-r--r--chrome/app/chrome_version_info.h18
-rw-r--r--chrome/app/chrome_version_info_posix.h.version26
3 files changed, 96 insertions, 0 deletions
diff --git a/chrome/app/chrome_version_info.cc b/chrome/app/chrome_version_info.cc
new file mode 100644
index 0000000..577cb32
--- /dev/null
+++ b/chrome/app/chrome_version_info.cc
@@ -0,0 +1,52 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/app/chrome_version_info.h"
+
+#include "base/basictypes.h"
+#include "base/file_version_info.h"
+#include "build/build_config.h"
+
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#include "chrome/app/chrome_version_info_posix.h"
+
+// Posix files don't have per-file version information, so we get chrome
+// version information from chrome_version_info_posix.h, a generated header.
+class ChromeVersionInfoPosix : public FileVersionInfo {
+ public:
+ ChromeVersionInfoPosix() {}
+
+ virtual std::wstring company_name() { return COMPANY_NAME; }
+ virtual std::wstring company_short_name() { return COMPANY_SHORT_NAME; }
+ virtual std::wstring product_name() { return PRODUCT_NAME; }
+ virtual std::wstring product_short_name() { return PRODUCT_SHORT_NAME; }
+ virtual std::wstring internal_name() { return INTERNAL_NAME; }
+ virtual std::wstring product_version() { return PRODUCT_VERSION; }
+ virtual std::wstring private_build() { return PRIVATE_BUILD; }
+ virtual std::wstring special_build() { return SPECIAL_BUILD; }
+ virtual std::wstring comments() { return COMMENTS; }
+ virtual std::wstring original_filename() { return ORIGINAL_FILENAME; }
+ virtual std::wstring file_description() { return FILE_DESCRIPTION; }
+ virtual std::wstring file_version() { return FILE_VERSION; }
+ virtual std::wstring legal_copyright() { return LEGAL_COPYRIGHT; }
+ virtual std::wstring legal_trademarks() { return LEGAL_TRADEMARKS; }
+ virtual std::wstring last_change() { return LAST_CHANGE; }
+ virtual bool is_official_build() { return OFFICIAL_BUILD; }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ChromeVersionInfoPosix);
+};
+#endif
+
+namespace chrome_app {
+
+FileVersionInfo* GetChromeVersionInfo() {
+#if defined(OS_WIN) || defined(OS_MACOSX)
+ return FileVersionInfo::CreateFileVersionInfoForCurrentModule();
+#elif defined(OS_POSIX)
+ return new ChromeVersionInfoPosix();
+#endif
+}
+
+} // namespace chrome_app
diff --git a/chrome/app/chrome_version_info.h b/chrome/app/chrome_version_info.h
new file mode 100644
index 0000000..472bcf4
--- /dev/null
+++ b/chrome/app/chrome_version_info.h
@@ -0,0 +1,18 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_APP_CHROME_VERSION_INFO_H_
+#define CHROME_APP_CHROME_VERSION_INFO_H_
+
+class FileVersionInfo;
+
+namespace chrome_app {
+
+// Creates a FileVersionInfo for the app, Chrome. Returns NULL in case of
+// error. The returned object should be deleted when you are done with it.
+FileVersionInfo* GetChromeVersionInfo();
+
+}
+
+#endif // CHROME_APP_CHROME_VERSION_INFO_H_
diff --git a/chrome/app/chrome_version_info_posix.h.version b/chrome/app/chrome_version_info_posix.h.version
new file mode 100644
index 0000000..01295f2
--- /dev/null
+++ b/chrome/app/chrome_version_info_posix.h.version
@@ -0,0 +1,26 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_APP_CHROME_VERSION_INFO_POSIX_H_
+#define CHROME_APP_CHROME_VERSION_INFO_POSIX_H_
+
+#define COMPANY_NAME L"@COMPANY_FULLNAME@"
+#define FILE_DESCRIPTION L"@PRODUCT_FULLNAME@"
+#define FILE_VERSION L"@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
+#define LEGAL_COPYRIGHT L"@COPYRIGHT@"
+#define PRODUCT_NAME L"@PRODUCT_FULLNAME@"
+#define PRODUCT_VERSION L"@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
+#define COMPANY_SHORT_NAME L"@COMPANY_SHORTNAME@"
+#define PRODUCT_SHORT_NAME L"@PRODUCT_SHORTNAME@"
+#define LAST_CHANGE L"@LASTCHANGE@"
+#define OFFICIAL_BUILD @OFFICIAL_BUILD@
+// TODO(mmoss) Do these have values for Linux?
+#define INTERNAL_NAME L""
+#define ORIGINAL_FILENAME L""
+#define PRIVATE_BUILD L""
+#define SPECIAL_BUILD L""
+#define COMMENTS L""
+#define LEGAL_TRADEMARKS L""
+
+#endif // CHROME_APP_CHROME_VERSION_INFO_POSIX_H_