chromium/components/omnibox/common/BUILD.gn

# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

source_set("common") {
  sources = [
    "omnibox_features.cc",
    "omnibox_features.h",
    "omnibox_focus_state.h",
    "zero_suggest_cache_service_interface.cc",
    "zero_suggest_cache_service_interface.h",
  ]
  deps = [
    "//base",
    "//ui/base:features",
  ]

  if (is_android) {
    deps += [ ":jni_headers" ]
  }
}

if (is_android) {
  import("//build/config/android/config.gni")
  import("//build/config/android/rules.gni")
  import("//third_party/jni_zero/jni_zero.gni")

  generate_jni("jni_headers") {
    sources = [
      "android/java/src/org/chromium/components/omnibox/OmniboxFeatureMap.java",
    ]
  }

  java_cpp_features("java_features_srcjar") {
    visibility = [ ":*" ]
    sources = [ "//components/omnibox/common/omnibox_features.cc" ]
    template = "//components/omnibox/common/java_templates/OmniboxFeatureList.java.tmpl"
  }

  android_library("features_java") {
    sources = [
      "android/java/src/org/chromium/components/omnibox/OmniboxFeatureMap.java",
      "android/java/src/org/chromium/components/omnibox/OmniboxFeatures.java",
    ]
    srcjar_deps = [
      ":java_features_srcjar",
      ":jni_headers",
    ]
    deps = [
      "//base:base_cached_flags_java",
      "//base:base_java",
      "//third_party/jni_zero:jni_zero_java",
      "//third_party/omnibox_proto:omnibox_proto_java",
    ]
  }
}