1// Copyright 2015 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 COMPONENTS_VERSION_INFO_VERSION_INFO_H_
6#define COMPONENTS_VERSION_INFO_VERSION_INFO_H_
7
8#include <string>
9
10#include "components/version_info/channel.h"
11
12namespace base {
13class Version;
14}
15
16namespace version_info {
17
18// Returns the product name and version information for UserAgent header,
19// e.g. "Chrome/a.b.c.d".
20std::string GetProductNameAndVersionForUserAgent();
21
22// Returns the product name, e.g. "Chromium" or "Google Chrome".
23std::string GetProductName();
24
25// Returns the version number, e.g. "6.0.490.1".
26std::string GetVersionNumber();
27
28// Returns the major component of the version, e.g. "6".
29std::string GetMajorVersionNumber();
30
31// Returns the result of GetVersionNumber() as a base::Version.
32const base::Version& GetVersion();
33
34// Returns a version control specific identifier of this release.
35std::string GetLastChange();
36
37// Returns whether this is an "official" release of the current version, i.e.
38// whether knowing GetVersionNumber() is enough to completely determine what
39// GetLastChange() is.
40bool IsOfficialBuild();
41
42// Returns the OS type, e.g. "Windows", "Linux", "FreeBSD", ...
43std::string GetOSType();
44
45// Returns a string equivalent of |channel|, independent of whether the build
46// is branded or not and without any additional modifiers.
47std::string GetChannelString(Channel channel);
48
49} // namespace version_info
50
51#endif // COMPONENTS_VERSION_INFO_VERSION_INFO_H_
52