OLD | NEW |
| (Empty) |
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 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "components/version_info/version_info.h" | |
12 | |
13 namespace chrome { | |
14 | |
15 // An instance of chrome::VersionInfo has information about the | |
16 // current running build of Chrome. | |
17 // TODO(sdefresne): this class should be removed in favor of calling directly | |
18 // version_info free functions and this file should just provide method to | |
19 // compute version string modifier (system dependent) and channel (embedder | |
20 // dependent). Tracked by http://crbug.com/514562. | |
21 class VersionInfo { | |
22 public: | |
23 VersionInfo(); | |
24 ~VersionInfo(); | |
25 | |
26 // E.g. "Chrome/a.b.c.d" | |
27 static std::string ProductNameAndVersionForUserAgent(); | |
28 | |
29 // E.g. "Chromium" or "Google Chrome". | |
30 static std::string Name(); | |
31 | |
32 // Version number, e.g. "6.0.490.1". | |
33 static std::string Version(); | |
34 | |
35 // The SVN revision of this release. E.g. "55800". | |
36 static std::string LastChange(); | |
37 | |
38 // Whether this is an "official" release of the current Version(): | |
39 // whether knowing Version() is enough to completely determine what | |
40 // LastChange() is. | |
41 static bool IsOfficialBuild(); | |
42 | |
43 // OS type. E.g. "Windows", "Linux", "FreeBSD", ... | |
44 static std::string OSType(); | |
45 | |
46 // Returns a human-readable modifier for the version string. For a branded | |
47 // build, this modifier is the channel ("canary", "dev", or "beta", but "" | |
48 // for stable). On Windows, this may be modified with additional information | |
49 // after a hyphen. For multi-user installations, it will return "canary-m", | |
50 // "dev-m", "beta-m", and for a stable channel multi-user installation, "m". | |
51 // In branded builds, when the channel cannot be determined, "unknown" will | |
52 // be returned. In unbranded builds, the modifier is usually an empty string | |
53 // (""), although on Linux, it may vary in certain distributions. | |
54 // GetVersionStringModifier() is intended to be used for display purposes. | |
55 // To simply test the channel, use GetChannel(). | |
56 static std::string GetVersionStringModifier(); | |
57 | |
58 // Returns the channel for the installation. In branded builds, this will be | |
59 // CHANNEL_STABLE, CHANNEL_BETA, CHANNEL_DEV, or CHANNEL_CANARY. In unbranded | |
60 // builds, or in branded builds when the channel cannot be determined, this | |
61 // will be CHANNEL_UNKNOWN. | |
62 static version_info::Channel GetChannel(); | |
63 | |
64 // Returns a string equivalent of the channel, independent of whether it is a | |
65 // branded build or not and without any additional modifiers. | |
66 static std::string GetChannelString(); | |
67 | |
68 #if defined(OS_CHROMEOS) | |
69 // Sets channel before use. | |
70 static void SetChannel(const std::string& channel); | |
71 #endif | |
72 | |
73 // Returns a version string to be displayed in "About Chromium" dialog. | |
74 static std::string CreateVersionString(); | |
75 | |
76 private: | |
77 DISALLOW_COPY_AND_ASSIGN(VersionInfo); | |
78 }; | |
79 | |
80 } // namespace chrome | |
81 | |
82 #endif // CHROME_COMMON_CHROME_VERSION_INFO_H_ | |
OLD | NEW |