Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Side by Side Diff: device/geolocation/BUILD.gn

Issue 2176753003: Geolocation: move from content/browser to device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed device/geolocation/public/cpp Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 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
5 import("//build/config/features.gni")
6 import("//mojo/public/tools/bindings/mojom.gni") # not needed?
7
8 if (is_android) {
9 import("//build/config/android/rules.gni") # For generate_jni().
10 }
11
12 component("device_geolocation") {
13 defines = [ "DEVICE_GEOLOCATION_IMPLEMENTATION" ]
14
15 sources = [
16 "access_token_store.h",
17 "android/geolocation_jni_registrar.cc",
18 "android/geolocation_jni_registrar.h",
19 "empty_wifi_data_provider.cc",
20 "empty_wifi_data_provider.h",
21 "geolocation_delegate.cc",
22 "geolocation_delegate.h",
23 "geolocation_export.h",
24 "geolocation_provider.h",
25 "geolocation_provider_impl.cc",
26 "geolocation_provider_impl.h",
27 "geolocation_service_context.cc",
28 "geolocation_service_context.h",
29 "geolocation_service_impl.cc",
30 "geolocation_service_impl.h",
31 "geoposition.cc",
32 "geoposition.h",
33 "location_api_adapter_android.cc",
34 "location_api_adapter_android.h",
35 "location_arbitrator.h",
36 "location_arbitrator_impl.cc",
37 "location_arbitrator_impl.h",
38 "location_provider.h",
39 "location_provider_android.cc",
40 "location_provider_android.h",
41 "location_provider_base.cc",
42 "location_provider_base.h",
43 "network_location_provider.cc",
44 "network_location_provider.h",
45 "network_location_request.cc",
46 "network_location_request.h",
47 "wifi_data.cc",
48 "wifi_data.h",
49 "wifi_data_provider.cc",
50 "wifi_data_provider.h",
51 "wifi_data_provider_chromeos.cc",
52 "wifi_data_provider_chromeos.h",
53 "wifi_data_provider_common.cc",
54 "wifi_data_provider_common.h",
55 "wifi_data_provider_common_win.cc",
56 "wifi_data_provider_common_win.h",
57 "wifi_data_provider_corewlan_mac.mm",
58 "wifi_data_provider_linux.cc",
59 "wifi_data_provider_linux.h",
60 "wifi_data_provider_mac.cc",
61 "wifi_data_provider_mac.h",
62 "wifi_data_provider_manager.cc",
63 "wifi_data_provider_manager.h",
64 "wifi_data_provider_win.cc",
65 "wifi_data_provider_win.h",
66 "wifi_polling_policy.h",
67 ]
68
69 deps = [
70 "//base",
71 "//google_apis:google_apis",
72 "//mojo/edk/system",
73 "//mojo/public/cpp/bindings",
74 "//net",
75
76 # TODO(mcasas): move geolocation.mojom to public/interfaces.
77 "//third_party/WebKit/public:mojo_bindings",
78 "//ui/gfx",
79 ]
80
81 if (is_android) {
82 sources -= [
83 "network_location_provider.cc",
84 "network_location_provider.h",
85 "network_location_request.cc",
86 "network_location_request.h",
87 ]
88 deps += [ ":geolocation_jni_headers" ]
89 }
90
91 # TODO(mcasas): prefer adding files than removing them (see cookbook.md).
92
93 # Dealing with *wifi_data_provider_*.cc is also a bit complicated given
94 # android, chromeos, linux and use_dbus.
95 if (is_android) {
96 sources -= [ "wifi_data_provider_common.cc" ]
97 }
98 if (is_chromeos || (is_linux && !use_dbus)) {
99 sources -= [ "wifi_data_provider_linux.cc" ]
100 }
101 if (is_linux && use_dbus) {
102 sources -= [ "empty_wifi_data_provider.cc" ]
103 deps += [ "//dbus" ]
104 }
105 if (is_win || is_mac) {
106 sources -= [
107 "empty_wifi_data_provider.cc",
108 "empty_wifi_data_provider.h",
109 ]
110 }
111 if (is_chromeos) {
112 deps += [ "//chromeos" ]
113 }
114
115 if (is_mac) {
116 libs = [ "Foundation.framework" ]
117 }
118 }
119
120 if (is_android) {
121 generate_jni("geolocation_jni_headers") {
122 sources = [
123 "android/java/org/chromium/device/geolocation/LocationProviderAdapter.java ",
124 ]
125 jni_package = "device"
126 }
127
128 android_library("geolocation_java") {
129 java_files = [
130 "android/java/org/chromium/device/geolocation/LocationProviderAdapter.java ",
131 "android/java/org/chromium/device/geolocation/LocationProviderFactory.java ",
132 ]
133
134 deps = [
135 ":device_geolocation",
136 ":geolocation_jni_headers",
137 "//base:base_java",
138 ]
139 }
140
141 android_library("geolocation_java_test_support") {
142 testonly = true
143
144 java_files = [ "android/java/org/chromium/device/geolocation/MockLocationPro vider.java" ]
145 deps = [
146 ":geolocation_java",
147 "//base:base_java",
148 ]
149 }
150 }
151
152 source_set("unittests") {
153 testonly = true
154
155 sources = [
156 "fake_access_token_store.cc",
157 "fake_access_token_store.h",
158 "geolocation_provider_impl_unittest.cc",
159 "location_arbitrator_impl_unittest.cc",
160 "mock_location_arbitrator.cc",
161 "mock_location_arbitrator.h",
162 "mock_location_provider.cc",
163 "mock_location_provider.h",
164 "network_location_provider_unittest.cc",
165 "wifi_data_provider_chromeos_unittest.cc",
166 "wifi_data_provider_common_unittest.cc",
167 "wifi_data_provider_linux_unittest.cc",
168 "wifi_data_provider_win_unittest.cc",
169 ]
170 public_deps = [
171 ":device_geolocation",
172 ]
173 deps = [
174 "//base",
175 "//base/third_party/dynamic_annotations",
176 "//net:test_support",
177 "//testing/gmock",
178 "//testing/gtest",
179 ]
180
181 if (is_linux) {
182 if (use_dbus) {
183 deps += [ "//dbus:test_support" ]
184 } else {
185 sources -= [ "wifi_data_provider_linux_unittest.cc" ]
186 }
187 }
188
189 if (is_chromeos) {
190 sources -= [ "wifi_data_provider_linux_unittest.cc" ]
191 deps += [ "//chromeos" ]
192 }
193
194 if (is_android) {
195 sources -= [
196 "network_location_provider_unittest.cc",
197 "wifi_data_provider_common_unittest.cc",
198 ]
199 deps += [ ":geolocation_java_test_support" ]
200 }
201 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698