# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//extensions/buildflags/buildflags.gni") if (is_android) { import("//build/config/android/config.gni") } config("implementation") { defines = [ "SESSIONS_IMPLEMENTATION" ] } if (!is_ios) { component("sessions") { sources = [ "content/content_live_tab.cc", "content/content_live_tab.h", "content/content_platform_specific_tab_data.cc", "content/content_platform_specific_tab_data.h", "content/content_record_password_state.cc", "content/content_record_password_state.h", "content/content_serialized_navigation_builder.cc", "content/content_serialized_navigation_builder.h", "content/content_serialized_navigation_driver.cc", "content/content_serialized_navigation_driver.h", "content/extended_info_handler.h", "content/navigation_task_id.cc", "content/navigation_task_id.h", "content/session_tab_helper.cc", "content/session_tab_helper.h", "content/session_tab_helper_delegate.h", ] configs += [ ":implementation" ] public_deps = [ ":shared", "//content/public/browser", ] deps = [ "//base", "//base/third_party/dynamic_annotations", "//content/public/common", "//extensions/buildflags", "//ui/base", "//url", ] if (enable_extensions) { deps += [ "//extensions/common" ] } } } else { source_set("sessions") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ "ios/ios_live_tab.h", "ios/ios_live_tab.mm", "ios/ios_restore_live_tab.h", "ios/ios_restore_live_tab.mm", "ios/ios_serialized_navigation_builder.h", "ios/ios_serialized_navigation_builder.mm", "ios/ios_serialized_navigation_driver.cc", "ios/ios_serialized_navigation_driver.h", "ios/ios_webstate_live_tab.h", "ios/ios_webstate_live_tab.mm", ] public_deps = [ ":shared", "//ios/web", ] deps = [ "//base", "//ios/web/common", "//ios/web/public/session", ] } } # Sources shared between the content and iOS implementations. source_set("shared") { visibility = [ ":*" ] sources = [ "core/base_session_service_commands.cc", "core/base_session_service_commands.h", "core/command_storage_backend.cc", "core/command_storage_backend.h", "core/command_storage_manager.cc", "core/command_storage_manager.h", "core/command_storage_manager_delegate.h", "core/live_tab.cc", "core/live_tab.h", "core/live_tab_context.h", "core/serialized_navigation_driver.h", "core/serialized_navigation_entry.cc", "core/serialized_navigation_entry.h", "core/serialized_user_agent_override.cc", "core/serialized_user_agent_override.h", "core/session_command.cc", "core/session_command.h", "core/session_constants.cc", "core/session_constants.h", "core/session_id.cc", "core/session_id.h", "core/session_id_generator.cc", "core/session_id_generator.h", "core/session_service_commands.cc", "core/session_service_commands.h", "core/session_types.cc", "core/session_types.h", "core/snapshotting_command_storage_backend.cc", "core/snapshotting_command_storage_backend.h", "core/snapshotting_command_storage_manager.cc", "core/snapshotting_command_storage_manager.h", "core/tab_restore_service.cc", "core/tab_restore_service.h", "core/tab_restore_service_client.cc", "core/tab_restore_service_client.h", "core/tab_restore_service_helper.cc", "core/tab_restore_service_helper.h", "core/tab_restore_service_impl.cc", "core/tab_restore_service_impl.h", "core/tab_restore_service_observer.h", ] configs += [ ":implementation" ] public_deps = [ "//components/keyed_service/core", "//skia", ] deps = [ "//base", "//components/dom_distiller/core", "//components/history/core/common", "//components/keyed_service/core", "//components/prefs", "//components/tab_groups", "//components/variations", "//crypto", "//skia", "//ui/base", "//ui/gfx", "//url", ] } static_library("test_support") { testonly = true sources = [ "core/serialized_navigation_entry_test_helper.cc", "core/serialized_navigation_entry_test_helper.h", ] public_deps = [ ":sessions" ] deps = [ "//base", "//skia", "//testing/gtest", "//ui/base", # For page_transition_types.h. "//url", ] if (!is_ios) { sources += [ "content/content_test_helper.cc", "content/content_test_helper.h", "core/command_storage_manager_test_helper.cc", "core/command_storage_manager_test_helper.h", ] deps += [ "//base/test:test_support", "//content/public/browser", "//content/public/common", ] } } source_set("unit_tests") { testonly = true sources = [ "core/command_storage_backend_unittest.cc", "core/serialized_navigation_entry_unittest.cc", "core/session_id_generator_unittest.cc", "core/snapshotting_session_backend_unittest.cc", ] if (!is_ios) { sources += [ "content/content_serialized_navigation_builder_unittest.cc", "content/content_serialized_navigation_driver_unittest.cc", "content/navigation_task_id_unittest.cc", ] } else { sources += [ "ios/ios_serialized_navigation_builder_unittest.mm", "ios/ios_serialized_navigation_driver_unittest.cc", ] configs += [ "//build/config/compiler:enable_arc" ] } public_deps = [ ":sessions" ] deps = [ ":test_support", "//base/test:test_support", "//components/prefs:test_support", "//testing/gmock", "//testing/gtest", "//ui/base", # For page transition types. "//url", ] if (!is_ios) { deps += [ "//content/public/common", "//content/test:test_support", ] } else { deps += [ "//ios/web/public/test" ] } }