| 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 CHROME_COMMON_CHROME_VERSION_INFO_H_ | 5 #ifndef CHROME_COMMON_CHROME_VERSION_INFO_H_ |
| 6 #define CHROME_COMMON_CHROME_VERSION_INFO_H_ | 6 #define CHROME_COMMON_CHROME_VERSION_INFO_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 | 13 |
| 14 class FileVersionInfo; | 14 class FileVersionInfo; |
| 15 | 15 |
| 16 namespace chrome { | 16 namespace chrome { |
| 17 | 17 |
| 18 // An instance of chrome::VersionInfo has information about the | 18 // An instance of chrome::VersionInfo has information about the |
| 19 // current running build of Chrome. | 19 // current running build of Chrome. |
| 20 class VersionInfo { | 20 class VersionInfo { |
| 21 public: | 21 public: |
| 22 VersionInfo(); | 22 VersionInfo(); |
| 23 ~VersionInfo(); | 23 ~VersionInfo(); |
| 24 | 24 |
| 25 // In the rare case where we fail to get the version info, | |
| 26 // is_valid() will return false. The other functions will return | |
| 27 // the empty string in this case, so it's not harmful if you don't | |
| 28 // check is_valid(). | |
| 29 bool is_valid() const; | |
| 30 | |
| 31 // E.g. "Chromium" or "Google Chrome". | 25 // E.g. "Chromium" or "Google Chrome". |
| 32 std::string Name() const; | 26 std::string Name() const; |
| 33 | 27 |
| 34 // Version number, e.g. "6.0.490.1". | 28 // Version number, e.g. "6.0.490.1". |
| 35 std::string Version() const; | 29 std::string Version() const; |
| 36 | 30 |
| 37 // The SVN revision of this release. E.g. "55800". | 31 // The SVN revision of this release. E.g. "55800". |
| 38 std::string LastChange() const; | 32 std::string LastChange() const; |
| 39 | 33 |
| 40 // Whether this is an "official" release of the current Version(): | 34 // Whether this is an "official" release of the current Version(): |
| 41 // whether knowing Version() is enough to completely determine what | 35 // whether knowing Version() is enough to completely determine what |
| 42 // LastChange() is. | 36 // LastChange() is. |
| 43 bool IsOfficialBuild() const; | 37 bool IsOfficialBuild() const; |
| 44 | 38 |
| 45 private: | 39 private: |
| 46 #if defined(OS_WIN) || defined(OS_MACOSX) | 40 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 47 scoped_ptr<FileVersionInfo> version_info_; | 41 scoped_ptr<FileVersionInfo> version_info_; |
| 48 #endif | 42 #endif |
| 49 | 43 |
| 50 DISALLOW_COPY_AND_ASSIGN(VersionInfo); | 44 DISALLOW_COPY_AND_ASSIGN(VersionInfo); |
| 51 }; | 45 }; |
| 52 | 46 |
| 53 } // namespace chrome | 47 } // namespace chrome |
| 54 | 48 |
| 55 #endif // CHROME_COMMON_CHROME_VERSION_INFO_H_ | 49 #endif // CHROME_COMMON_CHROME_VERSION_INFO_H_ |
| OLD | NEW |