| # Copyright 2016 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/chromeos/ui_mode.gni") |
| import("//build/config/features.gni") |
| |
| if (is_android) { |
| import("//build/config/android/rules.gni") # For generate_jni(). |
| } |
| |
| source_set("time_zone_monitor") { |
| visibility = [ "//services/device:lib" ] |
| |
| sources = [ |
| "time_zone_monitor.cc", |
| "time_zone_monitor.h", |
| ] |
| |
| deps = [ |
| "//base", |
| "//build:chromecast_buildflags", |
| "//mojo/public/cpp/bindings", |
| "//third_party/icu", |
| ] |
| |
| public_deps = [ "//services/device/public/mojom" ] |
| |
| if (is_android) { |
| sources += [ |
| "time_zone_monitor_android.cc", |
| "time_zone_monitor_android.h", |
| ] |
| deps += [ ":time_zone_monitor_jni_headers" ] |
| } |
| |
| if (is_win) { |
| sources += [ "time_zone_monitor_win.cc" ] |
| deps += [ "//ui/gfx" ] |
| } |
| |
| if (is_linux) { |
| sources += [ "time_zone_monitor_linux.cc" ] |
| deps += [ "//build:chromeos_buildflags" ] |
| } |
| |
| if (is_chromeos_ash) { |
| sources += [ "time_zone_monitor_ash.cc" ] |
| deps += [ "//ash/components/settings" ] |
| } |
| |
| if (is_chromeos_lacros) { |
| sources += [ |
| "time_zone_monitor_lacros.cc", |
| "time_zone_monitor_lacros.h", |
| |
| # Keep using linux implementation as a fallback. |
| # TODO(crbug.com/1288168): TODO clean up this, when we no longer need |
| # to support older ash. |
| "time_zone_monitor_linux.cc", |
| ] |
| deps += [ |
| "//build:chromeos_buildflags", |
| "//chromeos/crosapi/mojom", |
| "//chromeos/lacros", |
| ] |
| } |
| |
| if (is_mac) { |
| sources += [ "time_zone_monitor_mac.mm" ] |
| frameworks = [ "Foundation.framework" ] |
| } |
| |
| if (is_fuchsia) { |
| sources += [ "time_zone_monitor_fuchsia.cc" ] |
| } |
| } |
| |
| if (is_android) { |
| generate_jni("time_zone_monitor_jni_headers") { |
| visibility = [ ":time_zone_monitor" ] |
| sources = [ "android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java" ] |
| } |
| |
| android_library("java") { |
| # Conceptually, this should be visible only to //services/device:java. |
| # However, various generated targets also need to see this target as a |
| # result of //services/device:java depending on it. |
| visibility = [ "//services/device:*" ] |
| sources = [ "android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java" ] |
| deps = [ |
| "//base:base_java", |
| "//base:jni_java", |
| "//build/android:build_java", |
| ] |
| annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] |
| } |
| } |