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

Side by Side Diff: components/arc/power/arc_power_bridge.h

Issue 2805433002: Adding ArcBridge interface for synchronizing brightness settings (Closed)
Patch Set: Renaming 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 #ifndef COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_ 5 #ifndef COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_
6 #define COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_ 6 #define COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 23 matching lines...) Expand all
34 void OnInstanceReady() override; 34 void OnInstanceReady() override;
35 void OnInstanceClosed() override; 35 void OnInstanceClosed() override;
36 36
37 // chromeos::PowerManagerClient::Observer overrides. 37 // chromeos::PowerManagerClient::Observer overrides.
38 void SuspendImminent() override; 38 void SuspendImminent() override;
39 void SuspendDone(const base::TimeDelta& sleep_duration) override; 39 void SuspendDone(const base::TimeDelta& sleep_duration) override;
40 40
41 // DisplayConfigurator::Observer overrides. 41 // DisplayConfigurator::Observer overrides.
42 void OnPowerStateChanged(chromeos::DisplayPowerState power_state) override; 42 void OnPowerStateChanged(chromeos::DisplayPowerState power_state) override;
43 43
44 // PowerManagerClient::Observer overrides.
45 void BrightnessChanged(int level, bool user_initiated) override;
Luis Héctor Chávez 2017/04/06 01:36:20 argh, one more nit: Move this to after L39, with t
yueli 2017/04/06 16:43:00 Done.
46
44 // mojom::PowerHost overrides. 47 // mojom::PowerHost overrides.
45 void OnAcquireDisplayWakeLock(mojom::DisplayWakeLockType type) override; 48 void OnAcquireDisplayWakeLock(mojom::DisplayWakeLockType type) override;
46 void OnReleaseDisplayWakeLock(mojom::DisplayWakeLockType type) override; 49 void OnReleaseDisplayWakeLock(mojom::DisplayWakeLockType type) override;
47 void IsDisplayOn(const IsDisplayOnCallback& callback) override; 50 void IsDisplayOn(const IsDisplayOnCallback& callback) override;
51 void OnScreenBrightnessUpdateRequest(double percent) override;
48 52
49 private: 53 private:
50 void ReleaseAllDisplayWakeLocks(); 54 void ReleaseAllDisplayWakeLocks();
55 void UpdateAndroidScreenBrightness(double percent);
51 56
52 mojo::Binding<mojom::PowerHost> binding_; 57 mojo::Binding<mojom::PowerHost> binding_;
53 58
54 // Stores a mapping of type -> wake lock ID for all wake locks 59 // Stores a mapping of type -> wake lock ID for all wake locks
55 // held by ARC. 60 // held by ARC.
56 std::multimap<mojom::DisplayWakeLockType, int> wake_locks_; 61 std::multimap<mojom::DisplayWakeLockType, int> wake_locks_;
57 62
63 base::WeakPtrFactory<ArcPowerBridge> weak_ptr_factory_;
64
58 DISALLOW_COPY_AND_ASSIGN(ArcPowerBridge); 65 DISALLOW_COPY_AND_ASSIGN(ArcPowerBridge);
59 }; 66 };
60 67
61 } // namespace arc 68 } // namespace arc
62 69
63 #endif // COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_ 70 #endif // COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698