summaryrefslogtreecommitdiffstats
path: root/components/sessions/BUILD.gn
blob: bcc736699dacbf8a9324a9ab7d003aa3e8ebd1b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# 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.

if (is_android) {
  import("//build/config/android/config.gni")
}

config("implementation") {
  defines = [ "SESSIONS_IMPLEMENTATION" ]
}

if (!is_ios) {
  # GYP version: components/sessions.gypi:sessions_content
  component("sessions") {
    sources = [
      "content/content_serialized_navigation_builder.cc",
      "content/content_serialized_navigation_builder.h",
      "content/content_serialized_navigation_driver.cc",
      "content/content_serialized_navigation_driver.h",
    ]

    configs += [ ":implementation" ]

    deps = [
      ":shared",
      "//base",
      "//base/third_party/dynamic_annotations",
      "//content/public/browser",
      "//ui/base",
      "//url",
    ]
  }
} else {
  source_set("sessions") {
    sources = [
      "ios/ios_serialized_navigation_builder.cc",
      "ios/ios_serialized_navigation_builder.h",
      "ios/ios_serialized_navigation_driver.cc",
      "ios/ios_serialized_navigation_driver.h",
    ]

    deps = [
      ":shared",
      "//base",

      # '../ios/web/ios_web.gyp:ios_web',  TODO(GYP) iOS.
    ]
  }
}

# Sources shared between the content and iOS implementations.
source_set("shared") {
  visibility = [ ":*" ]

  sources = [
    "base_session_service.cc",
    "base_session_service.h",
    "base_session_service_commands.cc",
    "base_session_service_commands.h",
    "base_session_service_delegate.h",
    "core/serialized_navigation_driver.h",
    "serialized_navigation_entry.cc",
    "serialized_navigation_entry.h",
    "session_backend.cc",
    "session_backend.h",
    "session_command.cc",
    "session_command.h",
    "session_id.cc",
    "session_id.h",
    "session_service_commands.cc",
    "session_service_commands.h",
    "session_types.cc",
    "session_types.h",
  ]

  configs += [ ":implementation" ]

  deps = [
    "//base",
    "//skia",
    "//sync",
    "//sync/protocol",
    "//third_party/protobuf:protobuf_lite",
    "//ui/base",
    "//ui/gfx",
    "//url",
  ]
}

source_set("test_support") {
  testonly = true
  sources = [
    "serialized_navigation_entry_test_helper.cc",
    "serialized_navigation_entry_test_helper.h",
  ]

  public_deps = [
    ":sessions",
  ]
  deps = [
    "//skia",
    "//sync",
    "//testing/gtest",
  ]

  if (!is_android && !is_ios) {
    sources += [
      "base_session_service_test_helper.cc",
      "base_session_service_test_helper.h",
    ]
  }
}

if (!is_ios && !is_android) {
  source_set("unit_tests") {
    testonly = true
    sources = [
      "session_backend_unittest.cc",
      "session_types_unittest.cc",
    ]
    deps = [
      ":sessions",
      "//base/test:test_support",
      "//testing/gtest",
      "//third_party/protobuf:protobuf_lite",
    ]
  }
}