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

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

Issue 2805433002: Adding ArcBridge interface for synchronizing brightness settings (Closed)
Patch Set: Refactoring 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
« no previous file with comments | « components/arc/common/power.mojom ('k') | components/arc/power/arc_power_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 19 matching lines...) Expand all
30 explicit ArcPowerBridge(ArcBridgeService* bridge_service); 30 explicit ArcPowerBridge(ArcBridgeService* bridge_service);
31 ~ArcPowerBridge() override; 31 ~ArcPowerBridge() override;
32 32
33 // InstanceHolder<mojom::PowerInstance>::Observer overrides. 33 // InstanceHolder<mojom::PowerInstance>::Observer overrides.
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 void BrightnessChanged(int level, bool user_initiated) override;
40 41
41 // DisplayConfigurator::Observer overrides. 42 // DisplayConfigurator::Observer overrides.
42 void OnPowerStateChanged(chromeos::DisplayPowerState power_state) override; 43 void OnPowerStateChanged(chromeos::DisplayPowerState power_state) override;
43 44
44 // mojom::PowerHost overrides. 45 // mojom::PowerHost overrides.
45 void OnAcquireDisplayWakeLock(mojom::DisplayWakeLockType type) override; 46 void OnAcquireDisplayWakeLock(mojom::DisplayWakeLockType type) override;
46 void OnReleaseDisplayWakeLock(mojom::DisplayWakeLockType type) override; 47 void OnReleaseDisplayWakeLock(mojom::DisplayWakeLockType type) override;
47 void IsDisplayOn(const IsDisplayOnCallback& callback) override; 48 void IsDisplayOn(const IsDisplayOnCallback& callback) override;
49 void OnScreenBrightnessUpdateRequest(double percent) override;
48 50
49 private: 51 private:
50 void ReleaseAllDisplayWakeLocks(); 52 void ReleaseAllDisplayWakeLocks();
53 void UpdateAndroidScreenBrightness(double percent);
51 54
52 mojo::Binding<mojom::PowerHost> binding_; 55 mojo::Binding<mojom::PowerHost> binding_;
53 56
54 // Stores a mapping of type -> wake lock ID for all wake locks 57 // Stores a mapping of type -> wake lock ID for all wake locks
55 // held by ARC. 58 // held by ARC.
56 std::multimap<mojom::DisplayWakeLockType, int> wake_locks_; 59 std::multimap<mojom::DisplayWakeLockType, int> wake_locks_;
57 60
61 base::WeakPtrFactory<ArcPowerBridge> weak_ptr_factory_;
62
58 DISALLOW_COPY_AND_ASSIGN(ArcPowerBridge); 63 DISALLOW_COPY_AND_ASSIGN(ArcPowerBridge);
59 }; 64 };
60 65
61 } // namespace arc 66 } // namespace arc
62 67
63 #endif // COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_ 68 #endif // COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_
OLDNEW
« no previous file with comments | « components/arc/common/power.mojom ('k') | components/arc/power/arc_power_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698