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/version_info/version_info_values.h" | 8 #include "components/version_info/version_info_values.h" |
9 #include "grit/components_strings.h" | 9 #include "grit/components_strings.h" |
| 10 |
| 11 #if defined(USE_UNOFFICIAL_VERSION_NUMBER) |
10 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
| 13 #endif // USE_UNOFFICIAL_VERSION_NUMBER |
11 | 14 |
12 namespace version_info { | 15 namespace version_info { |
13 | 16 |
14 std::string GetProductNameAndVersionForUserAgent() { | 17 std::string GetProductNameAndVersionForUserAgent() { |
15 return "Chrome/" + GetVersionNumber(); | 18 return "Chrome/" + GetVersionNumber(); |
16 } | 19 } |
17 | 20 |
18 std::string GetProductName() { | 21 std::string GetProductName() { |
19 return PRODUCT_NAME; | 22 return PRODUCT_NAME; |
20 } | 23 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 case Channel::UNKNOWN: | 79 case Channel::UNKNOWN: |
77 return "unknown"; | 80 return "unknown"; |
78 break; | 81 break; |
79 } | 82 } |
80 return std::string(); | 83 return std::string(); |
81 } | 84 } |
82 | 85 |
83 std::string GetVersionStringWithModifier(const std::string& modifier) { | 86 std::string GetVersionStringWithModifier(const std::string& modifier) { |
84 std::string current_version; | 87 std::string current_version; |
85 current_version += GetVersionNumber(); | 88 current_version += GetVersionNumber(); |
86 #if !defined(GOOGLE_CHROME_BUILD) | 89 #if defined(USE_UNOFFICIAL_VERSION_NUMBER) |
87 current_version += " ("; | 90 current_version += " ("; |
88 current_version += l10n_util::GetStringUTF8(IDS_VERSION_UI_UNOFFICIAL); | 91 current_version += l10n_util::GetStringUTF8(IDS_VERSION_UI_UNOFFICIAL); |
89 current_version += " "; | 92 current_version += " "; |
90 current_version += GetLastChange(); | 93 current_version += GetLastChange(); |
91 current_version += " "; | 94 current_version += " "; |
92 current_version += GetOSType(); | 95 current_version += GetOSType(); |
93 current_version += ")"; | 96 current_version += ")"; |
94 #endif | 97 #endif // USE_UNOFFICIAL_VERSION_NUMBER |
95 if (!modifier.empty()) | 98 if (!modifier.empty()) |
96 current_version += " " + modifier; | 99 current_version += " " + modifier; |
97 return current_version; | 100 return current_version; |
98 } | 101 } |
99 | 102 |
100 } // namespace version_info | 103 } // namespace version_info |
OLD | NEW |