ChildAccountService[Java] delegates everything to native side.
[chromium-blink-merge.git] / device / battery / BUILD.gn
blob6eab81342c5bb1fe619d4b874627140ad3bdac55
1 # Copyright 2014 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.
5 import("//build/config/features.gni")
6 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
8 # On android, BatteryManager mojo service is implemented directly in Java.
9 if (!is_android) {
10   component("battery") {
11     output_name = "device_battery"
13     sources = [
14       "battery_export.h",
15       "battery_monitor_impl.cc",
16       "battery_monitor_impl.h",
17       "battery_status_manager_chromeos.cc",
18       "battery_status_manager_default.cc",
19       "battery_status_manager_linux.cc",
20       "battery_status_manager_linux.h",
21       "battery_status_manager_mac.cc",
22       "battery_status_manager_win.cc",
23       "battery_status_manager_win.h",
24       "battery_status_service.cc",
25       "battery_status_service.h",
26     ]
28     defines = [ "DEVICE_BATTERY_IMPLEMENTATION" ]
30     deps = [
31       ":mojo_bindings",
32       "//base",
33       "//base/third_party/dynamic_annotations",
34       "//mojo/environment:chromium",
35       "//third_party/mojo/src/mojo/public/cpp/bindings",
36       "//third_party/mojo/src/mojo/edk/system",
37     ]
39     if (is_chromeos) {
40       configs += [ "//build/config/linux:dbus" ]
41       deps += [
42         "//chromeos:chromeos",
43         "//chromeos:power_manager_proto",
44       ]
45       sources -= [
46         "battery_status_manager_default.cc",
47         "battery_status_manager_linux.cc",
48       ]
49     }
51     if (is_desktop_linux) {
52       if (use_dbus) {
53         configs += [ "//build/config/linux:dbus" ]
54         deps += [ "//dbus" ]
55         sources -= [ "battery_status_manager_default.cc" ]
56       } else {
57         sources -= [ "battery_status_manager_linux.cc" ]
58       }
59     }
61     if (is_mac) {
62       sources -= [ "battery_status_manager_default.cc" ]
63     }
65     if (is_win) {
66       sources -= [ "battery_status_manager_default.cc" ]
67     }
68   }
71 mojom("mojo_bindings") {
72   sources = [
73     "battery_monitor.mojom",
74     "battery_status.mojom",
75   ]