| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 // Requests to launch an app. | 49 // Requests to launch an app. |
| 50 bool LaunchApp(const std::string& package, | 50 bool LaunchApp(const std::string& package, |
| 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 bool NotifyVideoAcceleratorChannelCreated( |
| 59 const IPC::ChannelHandle& handle) override; |
| 60 |
| 58 private: | 61 private: |
| 59 friend class ArcBridgeTest; | 62 friend class ArcBridgeTest; |
| 60 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic); | 63 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic); |
| 61 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites); | 64 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites); |
| 62 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); | 65 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); |
| 63 | 66 |
| 64 // If all pre-requisites are true (ARC is available, it has been enabled, and | 67 // If all pre-requisites are true (ARC is available, it has been enabled, and |
| 65 // the session has started), and ARC is stopped, start ARC. If ARC is running | 68 // the session has started), and ARC is stopped, start ARC. If ARC is running |
| 66 // and the pre-requisites stop being true, stop ARC. | 69 // and the pre-requisites stop being true, stop ARC. |
| 67 void PrerequisitesChanged(); | 70 void PrerequisitesChanged(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 82 // Called whenever ARC sends app icon data for specific scale factor. | 85 // Called whenever ARC sends app icon data for specific scale factor. |
| 83 void OnAppIcon(const mojo::String& package, | 86 void OnAppIcon(const mojo::String& package, |
| 84 const mojo::String& activity, | 87 const mojo::String& activity, |
| 85 ScaleFactor scale_factor, | 88 ScaleFactor scale_factor, |
| 86 mojo::Array<uint8_t> icon_png_data) override; | 89 mojo::Array<uint8_t> icon_png_data) override; |
| 87 | 90 |
| 88 // Called when the instance requests wake lock services | 91 // Called when the instance requests wake lock services |
| 89 void OnAcquireDisplayWakeLock(DisplayWakeLockType type) override; | 92 void OnAcquireDisplayWakeLock(DisplayWakeLockType type) override; |
| 90 void OnReleaseDisplayWakeLock(DisplayWakeLockType type) override; | 93 void OnReleaseDisplayWakeLock(DisplayWakeLockType type) override; |
| 91 | 94 |
| 95 // Called whenever ARC sends request for video accelerator channel. |
| 96 void OnRequestArcVideoAcceleratorChannel() override; |
| 97 |
| 92 // ArcBridgeBootstrap::Delegate: | 98 // ArcBridgeBootstrap::Delegate: |
| 93 void OnConnectionEstablished(ArcBridgeInstancePtr instance) override; | 99 void OnConnectionEstablished(ArcBridgeInstancePtr instance) override; |
| 94 void OnStopped() override; | 100 void OnStopped() override; |
| 95 | 101 |
| 96 // DBus callbacks. | 102 // DBus callbacks. |
| 97 void OnArcAvailable(bool available); | 103 void OnArcAvailable(bool available); |
| 98 | 104 |
| 99 scoped_ptr<ArcBridgeBootstrap> bootstrap_; | 105 scoped_ptr<ArcBridgeBootstrap> bootstrap_; |
| 100 | 106 |
| 101 // Mojo endpoints. | 107 // Mojo endpoints. |
| 102 mojo::Binding<ArcBridgeHost> binding_; | 108 mojo::Binding<ArcBridgeHost> binding_; |
| 103 ArcBridgeInstancePtr instance_ptr_; | 109 ArcBridgeInstancePtr instance_ptr_; |
| 104 | 110 |
| 105 // If the user's session has started. | 111 // If the user's session has started. |
| 106 bool session_started_; | 112 bool session_started_; |
| 107 | 113 |
| 108 // WeakPtrFactory to use callbacks. | 114 // WeakPtrFactory to use callbacks. |
| 109 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; | 115 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; |
| 110 | 116 |
| 111 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); | 117 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); |
| 112 }; | 118 }; |
| 113 | 119 |
| 114 } // namespace arc | 120 } // namespace arc |
| 115 | 121 |
| 116 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ | 122 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ |
| OLD | NEW |