Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / common / chrome_version_info.h
blobb6a15aa6b7ff63139d325a6cb3a64d4bae390091
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.
5 #ifndef CHROME_COMMON_CHROME_VERSION_INFO_H_
6 #define CHROME_COMMON_CHROME_VERSION_INFO_H_
8 #include <string>
10 #include "base/basictypes.h"
12 namespace chrome {
14 // An instance of chrome::VersionInfo has information about the
15 // current running build of Chrome.
16 class VersionInfo {
17 public:
18 // The possible channels for an installation, from most fun to most stable.
19 enum Channel {
20 CHANNEL_UNKNOWN = 0, // Probably blue
21 CHANNEL_CANARY, // Yellow
22 CHANNEL_DEV, // Technicolor
23 CHANNEL_BETA, // Rainbow
24 CHANNEL_STABLE // Full-spectrum
27 VersionInfo();
28 ~VersionInfo();
30 // E.g. "Chrome/a.b.c.d"
31 std::string ProductNameAndVersionForUserAgent() const;
33 // E.g. "Chromium" or "Google Chrome".
34 std::string Name() const;
36 // Version number, e.g. "6.0.490.1".
37 std::string Version() const;
39 // The SVN revision of this release. E.g. "55800".
40 std::string LastChange() const;
42 // Whether this is an "official" release of the current Version():
43 // whether knowing Version() is enough to completely determine what
44 // LastChange() is.
45 bool IsOfficialBuild() const;
47 // OS type. E.g. "Windows", "Linux", "FreeBSD", ...
48 std::string OSType() const;
50 // Returns a human-readable modifier for the version string. For a branded
51 // build, this modifier is the channel ("canary", "dev", or "beta", but ""
52 // for stable). On Windows, this may be modified with additional information
53 // after a hyphen. For multi-user installations, it will return "canary-m",
54 // "dev-m", "beta-m", and for a stable channel multi-user installation, "m".
55 // In branded builds, when the channel cannot be determined, "unknown" will
56 // be returned. In unbranded builds, the modifier is usually an empty string
57 // (""), although on Linux, it may vary in certain distributions.
58 // GetVersionStringModifier() is intended to be used for display purposes.
59 // To simply test the channel, use GetChannel().
60 static std::string GetVersionStringModifier();
62 // Returns the channel for the installation. In branded builds, this will be
63 // CHANNEL_STABLE, CHANNEL_BETA, CHANNEL_DEV, or CHANNEL_CANARY. In unbranded
64 // builds, or in branded builds when the channel cannot be determined, this
65 // will be CHANNEL_UNKNOWN.
66 static Channel GetChannel();
68 // Returns a string equivalent of the channel, independent of whether it is a
69 // branded build or not and without any additional modifiers.
70 static std::string GetChannelString();
72 #if defined(OS_CHROMEOS)
73 // Sets channel before use.
74 static void SetChannel(const std::string& channel);
75 #endif
77 // Returns a version string to be displayed in "About Chromium" dialog.
78 std::string CreateVersionString() const;
80 private:
81 DISALLOW_COPY_AND_ASSIGN(VersionInfo);
84 } // namespace chrome
86 #endif // CHROME_COMMON_CHROME_VERSION_INFO_H_