version_string.cc 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2017 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. #include "components/version_info/version_string.h"
  5. #include "components/strings/grit/components_strings.h"
  6. #include "components/version_info/version_info.h"
  7. #if defined(USE_UNOFFICIAL_VERSION_NUMBER)
  8. #include "ui/base/l10n/l10n_util.h" // nogncheck
  9. #endif // USE_UNOFFICIAL_VERSION_NUMBER
  10. namespace version_info {
  11. std::string GetVersionStringWithModifier(const std::string& modifier) {
  12. std::string current_version;
  13. current_version += GetVersionNumber();
  14. #if defined(USE_UNOFFICIAL_VERSION_NUMBER)
  15. current_version += " (";
  16. current_version += l10n_util::GetStringUTF8(IDS_VERSION_UI_UNOFFICIAL);
  17. current_version += " ";
  18. current_version += GetLastChange();
  19. current_version += " ";
  20. current_version += GetOSType();
  21. current_version += ")";
  22. #endif // USE_UNOFFICIAL_VERSION_NUMBER
  23. if (!modifier.empty())
  24. current_version += " " + modifier;
  25. return current_version;
  26. }
  27. } // namespace version_info