123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- # Copyright 2014 The Chromium Authors. All rights reserved.
- # 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")
- static_library("storage_monitor") {
- sources = [
- "media_storage_util.cc",
- "media_storage_util.h",
- "removable_device_constants.cc",
- "removable_device_constants.h",
- "removable_storage_observer.h",
- "storage_info.cc",
- "storage_info.h",
- "storage_monitor.cc",
- "storage_monitor.h",
- "transient_device_ids.cc",
- "transient_device_ids.h",
- ]
- deps = [
- "//base",
- "//build:chromeos_buildflags",
- "//content/public/browser",
- "//mojo/public/cpp/bindings",
- "//services/service_manager/public/cpp",
- "//ui/base",
- ]
- if (is_win) {
- sources += [
- "portable_device_watcher_win.cc",
- "portable_device_watcher_win.h",
- "storage_monitor_win.cc",
- "storage_monitor_win.h",
- "volume_mount_watcher_win.cc",
- "volume_mount_watcher_win.h",
- ]
- } else if (is_mac) {
- sources += [
- "image_capture_device.h",
- "image_capture_device.mm",
- "image_capture_device_manager.h",
- "image_capture_device_manager.mm",
- "storage_monitor_mac.h",
- "storage_monitor_mac.mm",
- ]
- frameworks = [
- "DiskArbitration.framework",
- "Foundation.framework",
- "ImageCaptureCore.framework",
- ]
- } else if (is_chromeos_ash) {
- # For Chrome OS, |is_linux| is also true. Put this in an else-if block above
- # the |is_linux| else-if block, so they do not clash.
- sources += [
- "storage_monitor_chromeos.cc",
- "storage_monitor_chromeos.h",
- ]
- deps += [ "//ash/components/disks" ]
- if (use_dbus) {
- sources += [
- "mtp_manager_client_chromeos.cc",
- "mtp_manager_client_chromeos.h",
- "storage_info_utils.cc",
- "storage_info_utils.h",
- ]
- deps += [ "//services/device/public/mojom" ]
- }
- } else if (is_linux || is_chromeos_lacros) {
- if (use_udev) {
- sources += [
- "mtab_watcher_linux.cc",
- "mtab_watcher_linux.h",
- "storage_monitor_linux.cc",
- "storage_monitor_linux.h",
- ]
- } else {
- sources += [ "storage_monitor_dummy.cc" ]
- }
- }
- if (use_udev) {
- if (is_linux || is_chromeos) {
- sources += [
- "udev_util_linux.cc",
- "udev_util_linux.h",
- ]
- }
- deps += [ "//device/udev_linux" ]
- }
- if (is_fuchsia) {
- sources += [ "storage_monitor_fuchsia.cc" ]
- }
- }
- static_library("test_support") {
- testonly = true
- sources = [
- "mock_removable_storage_observer.cc",
- "mock_removable_storage_observer.h",
- "test_storage_monitor.cc",
- "test_storage_monitor.h",
- ]
- public_deps = [
- ":storage_monitor",
- "//base",
- "//content/public/browser",
- ]
- deps = [ "//build:chromeos_buildflags" ]
- if (is_chromeos_ash) {
- sources += [
- "test_media_transfer_protocol_manager_chromeos.cc",
- "test_media_transfer_protocol_manager_chromeos.h",
- ]
- if (use_dbus) {
- deps += [ "//services/device/public/mojom" ]
- }
- }
- if (is_win) {
- sources += [
- "test_portable_device_watcher_win.cc",
- "test_portable_device_watcher_win.h",
- "test_storage_monitor_win.cc",
- "test_storage_monitor_win.h",
- "test_volume_mount_watcher_win.cc",
- "test_volume_mount_watcher_win.h",
- ]
- deps += [ "//testing/gtest" ]
- }
- }
- source_set("unit_tests") {
- testonly = true
- sources = [
- "media_storage_util_unittest.cc",
- "storage_info_unittest.cc",
- "storage_monitor_unittest.cc",
- ]
- deps = [
- ":test_support",
- "//base/test:test_support",
- "//content/test:test_support",
- "//testing/gtest",
- ]
- if (is_win) {
- sources += [ "storage_monitor_win_unittest.cc" ]
- }
- if (is_mac) {
- sources += [
- "image_capture_device_manager_unittest.mm",
- "storage_monitor_mac_unittest.mm",
- ]
- }
- if (is_chromeos_ash) {
- if (use_dbus) {
- deps += [
- "//services/device/public/mojom",
- "//testing/gmock",
- ]
- sources += [
- "mtp_manager_client_chromeos_unittest.cc",
- "storage_monitor_chromeos_unittest.cc",
- ]
- }
- } else if (is_linux || is_chromeos_lacros) {
- if (use_udev) {
- sources += [ "storage_monitor_linux_unittest.cc" ]
- }
- }
- if (is_chromeos_ash) {
- deps += [ "//ash/components/disks:test_support" ]
- }
- }
|