BUILD.gn 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. # Copyright 2014 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("//build/config/ui.gni")
  5. import("//testing/test.gni")
  6. component("native_theme") {
  7. sources = [
  8. "caption_style.cc",
  9. "caption_style.h",
  10. "common_theme.cc",
  11. "common_theme.h",
  12. "native_theme.cc",
  13. "native_theme.h",
  14. "native_theme_base.cc",
  15. "native_theme_base.h",
  16. "native_theme_export.h",
  17. "native_theme_features.cc",
  18. "native_theme_features.h",
  19. "native_theme_observer.cc",
  20. "native_theme_observer.h",
  21. "native_theme_utils.cc",
  22. "native_theme_utils.h",
  23. ]
  24. if (is_android) {
  25. sources += [
  26. "native_theme_android.cc",
  27. "native_theme_android.h",
  28. ]
  29. }
  30. if (is_mac) {
  31. frameworks = [
  32. "CoreGraphics.framework",
  33. "AppKit.framework",
  34. "MediaAccessibility.framework",
  35. ]
  36. sources += [
  37. "caption_style_mac.mm",
  38. "native_theme_mac.h",
  39. "native_theme_mac.mm",
  40. "scrollbar_animator_mac.cc",
  41. "scrollbar_animator_mac.h",
  42. ]
  43. }
  44. if (is_win) {
  45. sources += [ "caption_style_win.cc" ]
  46. }
  47. if (use_aura || toolkit_views) {
  48. sources += [
  49. "native_theme_aura.cc",
  50. "native_theme_aura.h",
  51. "overlay_scrollbar_constants_aura.h",
  52. ]
  53. }
  54. defines = [ "NATIVE_THEME_IMPLEMENTATION" ]
  55. public_deps = [ "//skia" ]
  56. deps = [
  57. "//base",
  58. "//base/third_party/dynamic_annotations",
  59. "//build:chromeos_buildflags",
  60. "//cc/paint",
  61. "//ui/base",
  62. "//ui/color",
  63. # http://crbug.com/730719 - No !is_android to work around gn --check.
  64. "//ui/color:mixers",
  65. "//ui/display",
  66. "//ui/gfx",
  67. "//ui/gfx/animation/keyframe",
  68. "//ui/gfx/geometry",
  69. "//ui/resources",
  70. ]
  71. }
  72. if (is_win) {
  73. component("native_theme_browser") {
  74. defines = [ "NATIVE_THEME_IMPLEMENTATION" ]
  75. # These files cannot work in the renderer on Windows.
  76. sources = [
  77. "native_theme_win.cc",
  78. "native_theme_win.h",
  79. ]
  80. deps = [
  81. ":native_theme",
  82. "//base",
  83. "//cc/paint",
  84. "//ui/base",
  85. "//ui/color",
  86. "//ui/display",
  87. "//ui/gfx",
  88. ]
  89. libs = [ "uxtheme.lib" ]
  90. }
  91. } else {
  92. source_set("native_theme_browser") {
  93. }
  94. }
  95. source_set("test_support") {
  96. testonly = true
  97. deps = [
  98. ":native_theme",
  99. "//base",
  100. ]
  101. sources = [
  102. "test_native_theme.cc",
  103. "test_native_theme.h",
  104. ]
  105. }
  106. test("native_theme_unittests") {
  107. use_xvfb = use_xvfb_in_this_config
  108. sources = [ "native_theme_features_unittest.cc" ]
  109. if (use_aura) {
  110. sources += [ "native_theme_aura_unittest.cc" ]
  111. }
  112. if (is_win) {
  113. sources += [
  114. "caption_style_win_unittest.cc",
  115. "native_theme_win_unittest.cc",
  116. ]
  117. }
  118. deps = [
  119. ":native_theme",
  120. ":native_theme_browser",
  121. ":test_support",
  122. "//base/test:run_all_unittests",
  123. "//base/test:test_support",
  124. "//skia",
  125. "//testing/gtest",
  126. "//ui/base",
  127. "//ui/gfx/geometry:geometry",
  128. ]
  129. if (is_mac) {
  130. sources += [
  131. "native_theme_mac_unittest.mm",
  132. "scrollbar_animator_mac_unittest.cc",
  133. ]
  134. deps += [
  135. "//ui/color",
  136. "//ui/gfx:test_support",
  137. ]
  138. }
  139. }