credit_utils.cc 932 B

1234567891011121314151617181920212223242526272829303132
  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/about_ui/credit_utils.h"
  5. #include <stdint.h>
  6. #include "base/strings/string_piece.h"
  7. #include "build/chromeos_buildflags.h"
  8. #include "components/grit/components_resources.h"
  9. #include "ui/base/resource/resource_bundle.h"
  10. namespace about_ui {
  11. std::string GetCredits(bool include_scripts) {
  12. std::string response =
  13. ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
  14. IDR_ABOUT_UI_CREDITS_HTML);
  15. if (include_scripts) {
  16. #if BUILDFLAG(IS_CHROMEOS_ASH)
  17. response +=
  18. "<script src=\"chrome://credits/keyboard_utils.js\"></script>\n";
  19. #endif
  20. response +=
  21. "<script src=\"chrome://credits/credits.js\"></script>\n";
  22. }
  23. response += "</body>\n</html>";
  24. return response;
  25. }
  26. } // namespace about_ui