chrome_version_info.h revision ddb351dbec246cf1fab5ec20d2d5520909041de1
1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_COMMON_CHROME_VERSION_INFO_H_
6#define CHROME_COMMON_CHROME_VERSION_INFO_H_
7#pragma once
8
9#include <string>
10
11#include "base/basictypes.h"
12#include "base/memory/scoped_ptr.h"
13
14class FileVersionInfo;
15
16namespace chrome {
17
18// An instance of chrome::VersionInfo has information about the
19// current running build of Chrome.
20class VersionInfo {
21 public:
22  VersionInfo();
23  ~VersionInfo();
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".
32  std::string Name() const;
33
34  // Version number, e.g. "6.0.490.1".
35  std::string Version() const;
36
37  // The SVN revision of this release.  E.g. "55800".
38  std::string LastChange() const;
39
40  // Whether this is an "official" release of the current Version():
41  // whether knowing Version() is enough to completely determine what
42  // LastChange() is.
43  bool IsOfficialBuild() const;
44
45 private:
46#if defined(OS_WIN) || defined(OS_MACOSX)
47  scoped_ptr<FileVersionInfo> version_info_;
48#endif
49
50  DISALLOW_COPY_AND_ASSIGN(VersionInfo);
51};
52
53}  // namespace chrome
54
55#endif  // CHROME_COMMON_CHROME_VERSION_INFO_H_
56