BUILD.gn 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. if (is_android) {
  5. import("//build/config/android/config.gni")
  6. }
  7. config("implementation") {
  8. defines = [ "SESSIONS_IMPLEMENTATION" ]
  9. }
  10. if (!is_ios) {
  11. component("sessions") {
  12. sources = [
  13. "content/content_live_tab.cc",
  14. "content/content_live_tab.h",
  15. "content/content_platform_specific_tab_data.cc",
  16. "content/content_platform_specific_tab_data.h",
  17. "content/content_record_password_state.cc",
  18. "content/content_record_password_state.h",
  19. "content/content_serialized_navigation_builder.cc",
  20. "content/content_serialized_navigation_builder.h",
  21. "content/content_serialized_navigation_driver.cc",
  22. "content/content_serialized_navigation_driver.h",
  23. "content/extended_info_handler.h",
  24. "content/navigation_task_id.cc",
  25. "content/navigation_task_id.h",
  26. "content/session_tab_helper.cc",
  27. "content/session_tab_helper.h",
  28. "content/session_tab_helper_delegate.h",
  29. ]
  30. configs += [ ":implementation" ]
  31. public_deps = [
  32. ":shared",
  33. "//content/public/browser",
  34. ]
  35. deps = [
  36. "//base",
  37. "//base/third_party/dynamic_annotations",
  38. "//content/public/common",
  39. "//ui/base",
  40. "//url",
  41. ]
  42. }
  43. } else {
  44. source_set("sessions") {
  45. configs += [ "//build/config/compiler:enable_arc" ]
  46. sources = [
  47. "ios/ios_live_tab.h",
  48. "ios/ios_live_tab.mm",
  49. "ios/ios_restore_live_tab.h",
  50. "ios/ios_restore_live_tab.mm",
  51. "ios/ios_serialized_navigation_builder.h",
  52. "ios/ios_serialized_navigation_builder.mm",
  53. "ios/ios_serialized_navigation_driver.cc",
  54. "ios/ios_serialized_navigation_driver.h",
  55. "ios/ios_webstate_live_tab.h",
  56. "ios/ios_webstate_live_tab.mm",
  57. ]
  58. public_deps = [
  59. ":shared",
  60. "//ios/web",
  61. ]
  62. deps = [
  63. "//base",
  64. "//ios/web/common",
  65. "//ios/web/public/session",
  66. ]
  67. }
  68. }
  69. component("session_id") {
  70. sources = [
  71. "core/session_id.cc",
  72. "core/session_id.h",
  73. "core/session_id_generator.cc",
  74. "core/session_id_generator.h",
  75. ]
  76. configs += [ ":implementation" ]
  77. deps = [
  78. "//base",
  79. "//components/prefs",
  80. ]
  81. }
  82. # Sources shared between the content and iOS implementations.
  83. source_set("shared") {
  84. visibility = [ ":*" ]
  85. sources = [
  86. "core/base_session_service_commands.cc",
  87. "core/base_session_service_commands.h",
  88. "core/command_storage_backend.cc",
  89. "core/command_storage_backend.h",
  90. "core/command_storage_manager.cc",
  91. "core/command_storage_manager.h",
  92. "core/command_storage_manager_delegate.h",
  93. "core/live_tab.cc",
  94. "core/live_tab.h",
  95. "core/live_tab_context.h",
  96. "core/serialized_navigation_driver.h",
  97. "core/serialized_navigation_entry.cc",
  98. "core/serialized_navigation_entry.h",
  99. "core/serialized_user_agent_override.cc",
  100. "core/serialized_user_agent_override.h",
  101. "core/session_command.cc",
  102. "core/session_command.h",
  103. "core/session_constants.cc",
  104. "core/session_constants.h",
  105. "core/session_service_commands.cc",
  106. "core/session_service_commands.h",
  107. "core/session_types.cc",
  108. "core/session_types.h",
  109. "core/tab_restore_service.cc",
  110. "core/tab_restore_service.h",
  111. "core/tab_restore_service_client.cc",
  112. "core/tab_restore_service_client.h",
  113. "core/tab_restore_service_helper.cc",
  114. "core/tab_restore_service_helper.h",
  115. "core/tab_restore_service_impl.cc",
  116. "core/tab_restore_service_impl.h",
  117. "core/tab_restore_service_observer.h",
  118. ]
  119. configs += [ ":implementation" ]
  120. public_deps = [
  121. ":session_id",
  122. "//build:chromeos_buildflags",
  123. "//components/keyed_service/core",
  124. "//skia",
  125. ]
  126. deps = [
  127. "//base",
  128. "//components/dom_distiller/core",
  129. "//components/history/core/common",
  130. "//components/keyed_service/core",
  131. "//components/prefs",
  132. "//components/tab_groups",
  133. "//components/variations",
  134. "//crypto",
  135. "//skia",
  136. "//ui/base",
  137. "//ui/gfx",
  138. "//url",
  139. ]
  140. }
  141. static_library("test_support") {
  142. testonly = true
  143. sources = [
  144. "core/command_storage_manager_test_helper.cc",
  145. "core/command_storage_manager_test_helper.h",
  146. "core/serialized_navigation_entry_test_helper.cc",
  147. "core/serialized_navigation_entry_test_helper.h",
  148. ]
  149. public_deps = [ ":sessions" ]
  150. deps = [
  151. "//base",
  152. "//base/test:test_support",
  153. "//skia",
  154. "//testing/gtest",
  155. "//ui/base", # For page_transition_types.h.
  156. "//url",
  157. ]
  158. if (!is_ios) {
  159. sources += [
  160. "content/content_test_helper.cc",
  161. "content/content_test_helper.h",
  162. ]
  163. deps += [
  164. "//content/public/browser",
  165. "//content/public/common",
  166. ]
  167. }
  168. }
  169. source_set("unit_tests") {
  170. testonly = true
  171. sources = [
  172. "core/command_storage_backend_unittest.cc",
  173. "core/command_storage_manager_unittest.cc",
  174. "core/serialized_navigation_entry_unittest.cc",
  175. "core/session_id_generator_unittest.cc",
  176. ]
  177. if (!is_ios) {
  178. sources += [
  179. "content/content_serialized_navigation_builder_unittest.cc",
  180. "content/content_serialized_navigation_driver_unittest.cc",
  181. "content/navigation_task_id_unittest.cc",
  182. ]
  183. } else {
  184. sources += [
  185. "ios/ios_serialized_navigation_builder_unittest.mm",
  186. "ios/ios_serialized_navigation_driver_unittest.cc",
  187. ]
  188. configs += [ "//build/config/compiler:enable_arc" ]
  189. }
  190. public_deps = [ ":sessions" ]
  191. deps = [
  192. ":test_support",
  193. ":unit_tests_bundle_data",
  194. "//base/test:test_support",
  195. "//components/prefs:test_support",
  196. "//testing/gmock",
  197. "//testing/gtest",
  198. "//ui/base", # For page transition types.
  199. "//url",
  200. ]
  201. if (!is_ios) {
  202. deps += [
  203. "//content/public/common",
  204. "//content/test:test_support",
  205. ]
  206. } else {
  207. deps += [
  208. "//ios/web/public/test",
  209. "//ios/web/public/test:test_fixture",
  210. ]
  211. }
  212. }
  213. bundle_data("unit_tests_bundle_data") {
  214. visibility = [ ":unit_tests" ]
  215. testonly = true
  216. sources = [ "//components/test/data/sessions/last_session" ]
  217. outputs = [ "{{bundle_resources_dir}}/" +
  218. "{{source_root_relative_dir}}/{{source_file_part}}" ]
  219. }