chromium/chrome/browser/share/BUILD.gn

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

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

source_set("share") {
  sources = [
    "default_ranking.cc",
    "default_ranking.h",
    "share_attempt.cc",
    "share_attempt.h",
    "share_history.cc",
    "share_history.h",
    "share_ranking.cc",
    "share_ranking.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  public_deps = [ "//chrome/browser:browser_public_dependencies" ]

  deps = [
    "//base",
    "//chrome/browser/favicon",
    "//chrome/browser/profiles",
    "//chrome/browser/share/proto:proto",
    "//components/leveldb_proto:leveldb_proto",
    "//components/qr_code_generator:bitmap_generator",
    "//components/shared_highlighting/core/common",
    "//content/public/browser",
    "//skia",
    "//ui/gfx",
    "//ui/snapshot",
  ]

  if (is_android) {
    sources += [
      "bitmap_download_request.cc",
      "default_ranking_android.cc",
      "editor_screenshot_task.cc",
      "link_to_text_bridge.cc",
      "page_info_sharing_bridge.cc",
      "page_info_sharing_bridge.h",
      "qr_code_generator_android.cc",
    ]
    deps += [
      ":jni_headers",
      "//chrome/android:chrome_jni_headers",
      "//components/history/core/browser:browser",
      "//components/translate/content/browser",
      "//components/ukm/content:content",
      "//ui/android",
      "//url",
    ]
  }
}

if (is_android) {
  android_library("java") {
    srcjar_deps = [ ":jni_headers" ]
    sources = [
      "android/java/src/org/chromium/chrome/browser/share/ChromeShareExtras.java",
      "android/java/src/org/chromium/chrome/browser/share/ShareDelegate.java",
      "android/java/src/org/chromium/chrome/browser/share/ShareDelegateSupplier.java",
      "android/java/src/org/chromium/chrome/browser/share/ShareHistoryBridge.java",
      "android/java/src/org/chromium/chrome/browser/share/ShareRankingBridge.java",
      "android/java/src/org/chromium/chrome/browser/share/page_info_sheet/PageInfoSharingBridge.java",
      "android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeOptionShareCallback.java",
    ]

    deps = [
      ":jni_headers",
      "//base:base_java",
      "//build/android:build_java",
      "//chrome/browser/preferences:java",
      "//chrome/browser/profiles/android:java",
      "//chrome/browser/tab:java",
      "//components/browser_ui/share/android:java",
      "//content/public/android:content_java",
      "//third_party/androidx:androidx_annotation_annotation_java",
      "//third_party/jni_zero:jni_zero_java",
      "//ui/android:ui_java",
      "//url:gurl_java",
    ]
  }

  generate_jni("jni_headers") {
    sources = [
      "android/java/src/org/chromium/chrome/browser/share/ShareHistoryBridge.java",
      "android/java/src/org/chromium/chrome/browser/share/ShareRankingBridge.java",
      "android/java/src/org/chromium/chrome/browser/share/page_info_sheet/PageInfoSharingBridge.java",
    ]
  }
}