Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Side by Side Diff: components/arc/common/power.mojom

Issue 2805433002: Adding ArcBridge interface for synchronizing brightness settings (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Next min version: 3 5 // Next min version: 3
6 6
7 module arc.mojom; 7 module arc.mojom;
8 8
9 // Enumerates the types of wake lock the ARC instance can request from the 9 // Enumerates the types of wake lock the ARC instance can request from the
10 // host. 10 // host.
11 [Extensible] 11 [Extensible]
12 enum DisplayWakeLockType { 12 enum DisplayWakeLockType {
13 // Does not allow the screen to dim, turn off, or lock; prevents 13 // Does not allow the screen to dim, turn off, or lock; prevents
14 // idle suspend. 14 // idle suspend.
15 BRIGHT = 0, 15 BRIGHT = 0,
16 16
17 // Allows dimming the screen, but prevents it from turning off or locking. 17 // Allows dimming the screen, but prevents it from turning off or locking.
18 // Also prevents idle suspend. 18 // Also prevents idle suspend.
19 DIM = 1 19 DIM = 1
20 }; 20 };
21 21
22 // Next method ID: 3 22 // Next method ID: 3
Muyuan 2017/04/05 18:41:08 Next Method ID = max methodid in interface + 1
yueli 2017/04/05 19:59:47 Done.
23 interface PowerHost { 23 interface PowerHost {
24 // Acquire and release wake locks on the host side. 24 // Acquire and release wake locks on the host side.
25 OnAcquireDisplayWakeLock@0(DisplayWakeLockType type); 25 OnAcquireDisplayWakeLock@0(DisplayWakeLockType type);
26 OnReleaseDisplayWakeLock@1(DisplayWakeLockType type); 26 OnReleaseDisplayWakeLock@1(DisplayWakeLockType type);
27 27
28 // Checks if there is a display on. 28 // Checks if there is a display on.
29 [MinVersion=1] IsDisplayOn@2() => (bool is_on); 29 [MinVersion=1] IsDisplayOn@2() => (bool is_on);
30
31 // Set screen brightness.
Muyuan 2017/04/05 18:41:08 Same as L22
yueli 2017/04/05 19:59:47 Done.
32 SetBrightness@3(int32 brightness);
Muyuan 2017/04/05 18:41:08 add MinVersion
Luis Héctor Chávez 2017/04/05 19:14:40 Also document the range of |brightness|. I'd rathe
yueli 2017/04/05 19:59:46 Done.
33
34 // Synchronize screen brightness.
35 SyncBrightness@4();
Muyuan 2017/04/05 18:41:10 Same
Luis Héctor Chávez 2017/04/05 19:14:40 Why is this needed? Can't you always send the init
victorhsieh0 2017/04/05 19:14:51 nit: This name is a bit ambiguous to me. Would Re
yueli 2017/04/05 19:59:46 Done.
yueli 2017/04/05 21:19:55 Done.
30 }; 36 };
31 37
32 // Next method ID: 4 38 // Next method ID: 4
33 interface PowerInstance { 39 interface PowerInstance {
34 // Establishes full-duplex communication with the host. 40 // Establishes full-duplex communication with the host.
35 Init@0(PowerHost host_ptr); 41 Init@0(PowerHost host_ptr);
36 42
37 // Alerts the instance to a change in interactive state. 43 // Alerts the instance to a change in interactive state.
38 [MinVersion=1] SetInteractive@1(bool enabled); 44 [MinVersion=1] SetInteractive@1(bool enabled);
39 45
40 // Called when the system is about to suspend. The callback will be invoked 46 // Called when the system is about to suspend. The callback will be invoked
41 // when pre-suspend work is complete. 47 // when pre-suspend work is complete.
42 [MinVersion=2] Suspend@2() => (); 48 [MinVersion=2] Suspend@2() => ();
43 49
44 // Called when the system has just resumed. 50 // Called when the system has just resumed.
45 [MinVersion=2] Resume@3(); 51 [MinVersion=2] Resume@3();
52
53 // Update android brightness settings.
54 UpdateBrightness@4(int32 brightness);
Muyuan 2017/04/05 18:41:08 Same as L32
Luis Héctor Chávez 2017/04/05 19:14:40 Same as L32: please send the brightness as a doubl
yueli 2017/04/05 19:59:46 Done.
46 }; 55 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698