| 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_ARC_BRIDGE_SERVICE_IMPL_H_ | 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ |
| 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ | 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 const std::string& activity) override; | 51 const std::string& activity) override; |
| 52 | 52 |
| 53 // Requests to load an icon of specific scale_factor. | 53 // Requests to load an icon of specific scale_factor. |
| 54 bool RequestAppIcon(const std::string& package, | 54 bool RequestAppIcon(const std::string& package, |
| 55 const std::string& activity, | 55 const std::string& activity, |
| 56 ScaleFactor scale_factor) override; | 56 ScaleFactor scale_factor) override; |
| 57 | 57 |
| 58 // Requests ARC process list. | 58 // Requests ARC process list. |
| 59 bool RequestProcessList() override; | 59 bool RequestProcessList() override; |
| 60 | 60 |
| 61 void NotifyVideoAcceleratorChannelCreated( |
| 62 const IPC::ChannelHandle& handle) override; |
| 63 |
| 61 private: | 64 private: |
| 62 friend class ArcBridgeTest; | 65 friend class ArcBridgeTest; |
| 63 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic); | 66 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic); |
| 64 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites); | 67 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites); |
| 65 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); | 68 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); |
| 66 | 69 |
| 67 // If all pre-requisites are true (ARC is available, it has been enabled, and | 70 // If all pre-requisites are true (ARC is available, it has been enabled, and |
| 68 // the session has started), and ARC is stopped, start ARC. If ARC is running | 71 // the session has started), and ARC is stopped, start ARC. If ARC is running |
| 69 // and the pre-requisites stop being true, stop ARC. | 72 // and the pre-requisites stop being true, stop ARC. |
| 70 void PrerequisitesChanged(); | 73 void PrerequisitesChanged(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 89 mojo::Array<uint8_t> icon_png_data) override; | 92 mojo::Array<uint8_t> icon_png_data) override; |
| 90 | 93 |
| 91 // Called when the latest process list is reported from ARC. | 94 // Called when the latest process list is reported from ARC. |
| 92 void OnUpdateProcessList( | 95 void OnUpdateProcessList( |
| 93 mojo::Array<RunningAppProcessInfoPtr> processes_ptr) override; | 96 mojo::Array<RunningAppProcessInfoPtr> processes_ptr) override; |
| 94 | 97 |
| 95 // Called when the instance requests wake lock services | 98 // Called when the instance requests wake lock services |
| 96 void OnAcquireDisplayWakeLock(DisplayWakeLockType type) override; | 99 void OnAcquireDisplayWakeLock(DisplayWakeLockType type) override; |
| 97 void OnReleaseDisplayWakeLock(DisplayWakeLockType type) override; | 100 void OnReleaseDisplayWakeLock(DisplayWakeLockType type) override; |
| 98 | 101 |
| 102 // Called whenever ARC sends request for video accelerator channel. |
| 103 void OnRequestArcVideoAcceleratorChannel() override; |
| 104 |
| 99 // ArcBridgeBootstrap::Delegate: | 105 // ArcBridgeBootstrap::Delegate: |
| 100 void OnConnectionEstablished(ArcBridgeInstancePtr instance) override; | 106 void OnConnectionEstablished(ArcBridgeInstancePtr instance) override; |
| 101 void OnStopped() override; | 107 void OnStopped() override; |
| 102 | 108 |
| 103 // DBus callbacks. | 109 // DBus callbacks. |
| 104 void OnArcAvailable(bool available); | 110 void OnArcAvailable(bool available); |
| 105 | 111 |
| 106 scoped_ptr<ArcBridgeBootstrap> bootstrap_; | 112 scoped_ptr<ArcBridgeBootstrap> bootstrap_; |
| 107 | 113 |
| 108 // Mojo endpoints. | 114 // Mojo endpoints. |
| 109 mojo::Binding<ArcBridgeHost> binding_; | 115 mojo::Binding<ArcBridgeHost> binding_; |
| 110 ArcBridgeInstancePtr instance_ptr_; | 116 ArcBridgeInstancePtr instance_ptr_; |
| 111 | 117 |
| 112 // If the user's session has started. | 118 // If the user's session has started. |
| 113 bool session_started_; | 119 bool session_started_; |
| 114 | 120 |
| 115 // WeakPtrFactory to use callbacks. | 121 // WeakPtrFactory to use callbacks. |
| 116 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; | 122 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; |
| 117 | 123 |
| 118 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); | 124 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); |
| 119 }; | 125 }; |
| 120 | 126 |
| 121 } // namespace arc | 127 } // namespace arc |
| 122 | 128 |
| 123 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ | 129 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ |
| OLD | NEW |