| OLD | NEW |
| 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" |
| 11 #include "components/arc/arc_service.h" | 11 #include "components/arc/arc_service.h" |
| 12 #include "components/arc/common/power.mojom.h" | 12 #include "components/arc/common/power.mojom.h" |
| 13 #include "components/arc/instance_holder.h" | 13 #include "components/arc/instance_holder.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "ui/display/manager/chromeos/display_configurator.h" | 15 #include "ui/display/manager/chromeos/display_configurator.h" |
| 16 | 16 |
| 17 namespace arc { | 17 namespace arc { |
| 18 | 18 |
| 19 class ArcBridgeService; | 19 class ArcBridgeService; |
| 20 | 20 |
| 21 // ARC Power Client sets power management policy based on requests from | 21 // ARC Power Client sets power management policy based on requests from |
| 22 // ARC instances. | 22 // ARC instances. |
| 23 class ArcPowerBridge : public ArcService, | 23 class ArcPowerBridge : public ArcService, |
| 24 public InstanceHolder<mojom::PowerInstance>::Observer, | 24 public InstanceHolder<mojom::PowerInstance>::Observer, |
| 25 public ui::DisplayConfigurator::Observer, | 25 public display::DisplayConfigurator::Observer, |
| 26 public mojom::PowerHost { | 26 public mojom::PowerHost { |
| 27 public: | 27 public: |
| 28 explicit ArcPowerBridge(ArcBridgeService* bridge_service); | 28 explicit ArcPowerBridge(ArcBridgeService* bridge_service); |
| 29 ~ArcPowerBridge() override; | 29 ~ArcPowerBridge() override; |
| 30 | 30 |
| 31 // InstanceHolder<mojom::PowerInstance>::Observer overrides. | 31 // InstanceHolder<mojom::PowerInstance>::Observer overrides. |
| 32 void OnInstanceReady() override; | 32 void OnInstanceReady() override; |
| 33 void OnInstanceClosed() override; | 33 void OnInstanceClosed() override; |
| 34 | 34 |
| 35 // DisplayConfigurator::Observer overrides. | 35 // DisplayConfigurator::Observer overrides. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 49 // Stores a mapping of type -> wake lock ID for all wake locks | 49 // Stores a mapping of type -> wake lock ID for all wake locks |
| 50 // held by ARC. | 50 // held by ARC. |
| 51 std::multimap<mojom::DisplayWakeLockType, int> wake_locks_; | 51 std::multimap<mojom::DisplayWakeLockType, int> wake_locks_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(ArcPowerBridge); | 53 DISALLOW_COPY_AND_ASSIGN(ArcPowerBridge); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace arc | 56 } // namespace arc |
| 57 | 57 |
| 58 #endif // COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_ | 58 #endif // COMPONENTS_ARC_POWER_ARC_POWER_BRIDGE_H_ |
| OLD | NEW |