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