# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
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",
"//content/public/common",
"//ui/base",
"//url",
]
}
} else {
source_set("sessions") {
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/public",
"//ios/web/public/session/proto",
]
deps = [
"//base",
"//ios/web/common",
"//ios/web/public/session",
"//ios/web/public/session/proto:proto_util",
]
}
}
component("session_id") {
sources = [
"core/session_id.cc",
"core/session_id.h",
"core/session_id_generator.cc",
"core/session_id_generator.h",
"core/sessions_export.h",
]
configs += [ ":implementation" ]
deps = [
"//base",
"//components/prefs",
]
}
# 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_service_commands.cc",
"core/session_service_commands.h",
"core/session_types.cc",
"core/session_types.h",
"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",
"core/tab_restore_types.cc",
"core/tab_restore_types.h",
]
configs += [ ":implementation" ]
public_deps = [
":session_id",
"//build:chromeos_buildflags",
"//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/command_storage_manager_test_helper.cc",
"core/command_storage_manager_test_helper.h",
"core/serialized_navigation_entry_test_helper.cc",
"core/serialized_navigation_entry_test_helper.h",
]
public_deps = [ ":sessions" ]
deps = [
"//base",
"//base/test:test_support",
"//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",
]
deps += [
"//content/public/browser",
"//content/public/common",
]
}
}
source_set("unit_tests") {
testonly = true
sources = [
"core/command_storage_backend_unittest.cc",
"core/command_storage_manager_unittest.cc",
"core/serialized_navigation_entry_unittest.cc",
"core/session_id_generator_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",
]
}
public_deps = [ ":sessions" ]
deps = [
":test_support",
":unit_tests_bundle_data",
"//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",
"//ios/web/public/test:test_fixture",
]
}
}
bundle_data("unit_tests_bundle_data") {
visibility = [ ":unit_tests" ]
testonly = true
sources = [ "//components/test/data/sessions/last_session" ]
outputs = [ "{{bundle_resources_dir}}/" +
"{{source_root_relative_dir}}/{{source_file_part}}" ]
}