OLD | NEW |
| (Empty) |
1 # Copyright 2016 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. | |
4 | |
5 import("//build/config/features.gni") | |
6 import("//build/config/ui.gni") | |
7 | |
8 if (is_android) { | |
9 import("//build/config/android/rules.gni") | |
10 } | |
11 | |
12 component("power_save_blocker") { | |
13 sources = [ | |
14 "power_save_blocker.h", | |
15 "power_save_blocker_android.cc", | |
16 "power_save_blocker_android.h", | |
17 "power_save_blocker_chromeos.cc", | |
18 "power_save_blocker_impl.cc", | |
19 "power_save_blocker_impl.h", | |
20 "power_save_blocker_mac.cc", | |
21 "power_save_blocker_ozone.cc", | |
22 "power_save_blocker_win.cc", | |
23 "power_save_blocker_x11.cc", | |
24 ] | |
25 | |
26 defines = [ "DEVICE_POWER_SAVE_BLOCKER_IMPLEMENTATION" ] | |
27 | |
28 deps = [ | |
29 "//base", | |
30 ] | |
31 | |
32 if (use_dbus) { | |
33 deps += [ "//dbus" ] | |
34 } | |
35 | |
36 if (use_x11) { | |
37 configs += [ "//build/config/linux:x11" ] | |
38 if (!is_chromeos) { | |
39 configs += [ "//build/config/linux:xscrnsaver" ] | |
40 } | |
41 deps += [ "//ui/gfx/x" ] | |
42 } | |
43 | |
44 # Dealing with power_save_blocker_{x11,ozone}.cc is a little complicated | |
45 # given the interaction between os_chromeos and the feature flags for X11 and | |
46 # ozone, so do it all in one spot. | |
47 if (is_chromeos || !use_ozone) { | |
48 sources -= [ "power_save_blocker_ozone.cc" ] | |
49 } | |
50 if (is_chromeos || !use_x11) { | |
51 sources -= [ "power_save_blocker_x11.cc" ] | |
52 } | |
53 | |
54 if (is_android) { | |
55 sources += [ | |
56 "power_save_blocker_jni_registrar.cc", | |
57 "power_save_blocker_jni_registrar.h", | |
58 ] | |
59 | |
60 deps += [ | |
61 ":jni_headers", | |
62 "//ui/android", | |
63 ] | |
64 } | |
65 | |
66 if (is_chromeos) { | |
67 deps += [ | |
68 "//chromeos", | |
69 "//chromeos:power_manager_proto", | |
70 ] | |
71 } | |
72 } | |
73 | |
74 if (is_android) { | |
75 java_sources_needing_jni = [ "android/java/src/org/chromium/device/power_save_
blocker/PowerSaveBlocker.java" ] | |
76 | |
77 generate_jni("jni_headers") { | |
78 sources = java_sources_needing_jni | |
79 jni_package = "device" | |
80 } | |
81 | |
82 android_library("java") { | |
83 java_files = java_sources_needing_jni | |
84 deps = [ | |
85 "//base:base_java", | |
86 "//ui/android:ui_java", | |
87 ] | |
88 } | |
89 } | |
OLD | NEW |