OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #include "components/version_info/version_info.h" | 5 #include "components/version_info/version_info.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "components/strings/grit/components_strings.h" | |
9 #include "components/version_info/version_info_values.h" | 8 #include "components/version_info/version_info_values.h" |
10 | 9 |
11 #if defined(USE_UNOFFICIAL_VERSION_NUMBER) | 10 #if defined(USE_UNOFFICIAL_VERSION_NUMBER) |
12 #include "ui/base/l10n/l10n_util.h" // nogncheck | 11 #include "ui/base/l10n/l10n_util.h" // nogncheck |
13 #endif // USE_UNOFFICIAL_VERSION_NUMBER | 12 #endif // USE_UNOFFICIAL_VERSION_NUMBER |
14 | 13 |
15 namespace version_info { | 14 namespace version_info { |
16 | 15 |
17 std::string GetProductNameAndVersionForUserAgent() { | 16 std::string GetProductNameAndVersionForUserAgent() { |
18 return "Chrome/" + GetVersionNumber(); | 17 return "Chrome/" + GetVersionNumber(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 case Channel::CANARY: | 75 case Channel::CANARY: |
77 return "canary"; | 76 return "canary"; |
78 break; | 77 break; |
79 case Channel::UNKNOWN: | 78 case Channel::UNKNOWN: |
80 return "unknown"; | 79 return "unknown"; |
81 break; | 80 break; |
82 } | 81 } |
83 return std::string(); | 82 return std::string(); |
84 } | 83 } |
85 | 84 |
86 std::string GetVersionStringWithModifier(const std::string& modifier) { | |
87 std::string current_version; | |
88 current_version += GetVersionNumber(); | |
89 #if defined(USE_UNOFFICIAL_VERSION_NUMBER) | |
90 current_version += " ("; | |
91 current_version += l10n_util::GetStringUTF8(IDS_VERSION_UI_UNOFFICIAL); | |
92 current_version += " "; | |
93 current_version += GetLastChange(); | |
94 current_version += " "; | |
95 current_version += GetOSType(); | |
96 current_version += ")"; | |
97 #endif // USE_UNOFFICIAL_VERSION_NUMBER | |
98 if (!modifier.empty()) | |
99 current_version += " " + modifier; | |
100 return current_version; | |
101 } | |
102 | |
103 } // namespace version_info | 85 } // namespace version_info |
OLD | NEW |