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