summaryrefslogtreecommitdiff
path: root/chromium/ui/shell_dialogs/BUILD.gn
blob: bd4d92a194be7990c5f2ac7da54f85551735a620 (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
# 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("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//testing/test.gni")
if (is_android) {
  import("//build/config/android/config.gni")
}
if (is_mac) {
  import("//build/config/mac/rules.gni")
}

jumbo_component("shell_dialogs") {
  sources = [
    "base_shell_dialog.cc",
    "base_shell_dialog.h",
    "base_shell_dialog_win.cc",
    "base_shell_dialog_win.h",
    "execute_select_file_win.cc",
    "execute_select_file_win.h",
    "select_file_dialog.cc",
    "select_file_dialog.h",
    "select_file_dialog_factory.cc",
    "select_file_dialog_factory.h",
    "select_file_dialog_mac.h",
    "select_file_dialog_mac.mm",
    "select_file_dialog_win.cc",
    "select_file_dialog_win.h",
    "select_file_policy.cc",
    "select_file_policy.h",
    "selected_file_info.cc",
    "selected_file_info.h",
    "shell_dialog_linux.cc",
    "shell_dialog_linux.h",
    "shell_dialogs_export.h",
  ]

  defines = [ "SHELL_DIALOGS_IMPLEMENTATION" ]

  deps = [
    "//base",
    "//base:i18n",
    "//skia",
    "//ui/base",
    "//ui/strings",
  ]

  if (use_aura) {
    if (is_mac) {
      # Will be automatically filtered out on non-Mac.
      sources -= [ "select_file_dialog_mac.mm" ]
    }
    deps += [ "//ui/aura" ]
  }

  if (is_android) {
    sources += [
      "select_file_dialog_android.cc",
      "select_file_dialog_android.h",
    ]
    deps += [
      "//ui/android",
      "//ui/base:ui_base_jni_headers",
    ]
    include_dirs = [ "$root_gen_dir/ui" ]
    libs = [ "jnigraphics" ]
  }

  if (is_mac) {
    libs = [
      "CoreServices.framework",
      "Foundation.framework",
      "AppKit.framework",
    ]
  }

  if (is_fuchsia) {
    sources += [ "select_file_dialog_fuchsia.cc" ]
  }
}

if (is_mac) {
  mac_xib_bundle_data("shell_dialogs_unittests_xibs") {
    testonly = true
    sources = [
      "//chrome/app/nibs/SaveAccessoryView.xib",
    ]
  }

  mac_framework_bundle("shell_dialogs_unittests_bundle") {
    testonly = true
    framework_version = "S"
    framework_contents = [ "Resources" ]
    info_plist = "//ui/base/test/framework-Info.plist"
    deps = [
      ":shell_dialogs_unittests_xibs",
      "//ui/resources:ui_test_pak_bundle_data",
    ]
    extra_substitutions = [ "CHROMIUM_BUNDLE_ID=$target_name" ]
  }
}

test("shell_dialogs_unittests") {
  testonly = true
  sources = [
    "execute_select_file_win_unittest.cc",
    "run_all_unittests.cc",
    "select_file_dialog_mac_unittest.mm",
    "select_file_dialog_unittest.cc",
    "select_file_dialog_win_unittest.cc",
  ]

  deps = [
    ":shell_dialogs",
    "//base",
    "//base/test:test_support",
    "//testing/gtest",
    "//ui/base",
    "//ui/resources:ui_test_pak_data",
    "//ui/strings",
  ]

  if (is_mac) {
    deps += [ ":shell_dialogs_unittests_bundle" ]
  }
}