BUILD.gn 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Copyright 2019 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. import("linux/buildflags/buildflags.gni")
  5. component("system_media_controls") {
  6. friend = [ ":unit_tests" ]
  7. public = [
  8. "system_media_controls.h",
  9. "system_media_controls_observer.h",
  10. ]
  11. defines = [ "IS_SYSTEM_MEDIA_CONTROLS_IMPL" ]
  12. deps = [
  13. "//base",
  14. "//services/media_session/public/cpp",
  15. "//ui/gfx",
  16. ]
  17. public_deps = [ "//skia" ]
  18. if (is_win) {
  19. sources = [
  20. "win/system_media_controls_win.cc",
  21. "win/system_media_controls_win.h",
  22. ]
  23. } else if (use_mpris) {
  24. sources = [
  25. "linux/system_media_controls_linux.cc",
  26. "linux/system_media_controls_linux.h",
  27. ]
  28. deps += [
  29. "//build:branding_buildflags",
  30. "//components/dbus/properties",
  31. "//components/dbus/thread_linux",
  32. "//dbus",
  33. ]
  34. } else if (is_mac) {
  35. sources = [
  36. "mac/now_playing_info_center_delegate.h",
  37. "mac/now_playing_info_center_delegate.mm",
  38. "mac/now_playing_info_center_delegate_cocoa.h",
  39. "mac/now_playing_info_center_delegate_cocoa.mm",
  40. "mac/remote_command_center_delegate.h",
  41. "mac/remote_command_center_delegate.mm",
  42. "mac/remote_command_center_delegate_cocoa.h",
  43. "mac/remote_command_center_delegate_cocoa.mm",
  44. "mac/system_media_controls_mac.h",
  45. "mac/system_media_controls_mac.mm",
  46. ]
  47. deps += [ "//build:branding_buildflags" ]
  48. frameworks = [ "Foundation.framework" ]
  49. weak_frameworks = [ "MediaPlayer.framework" ]
  50. } else {
  51. sources = [ "system_media_controls_stub.cc" ]
  52. }
  53. }
  54. source_set("unit_tests") {
  55. testonly = true
  56. if (use_mpris) {
  57. sources = [ "linux/system_media_controls_linux_unittest.cc" ]
  58. deps = [
  59. ":system_media_controls",
  60. "//base",
  61. "//base/test:test_support",
  62. "//components/dbus/thread_linux",
  63. "//dbus",
  64. "//dbus:test_support",
  65. "//testing/gmock",
  66. "//testing/gtest",
  67. ]
  68. }
  69. }
  70. static_library("test_support") {
  71. testonly = true
  72. sources = [
  73. "mock_system_media_controls.cc",
  74. "mock_system_media_controls.h",
  75. ]
  76. deps = [
  77. ":system_media_controls",
  78. "//base",
  79. "//testing/gmock",
  80. ]
  81. }