OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSION
_H_ |
| 6 #define EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSION
_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "extensions/common/mojo/wifi_display_session_service.mojom.h" |
| 11 #include "extensions/renderer/api/display_source/display_source_session.h" |
| 12 #include "mojo/public/cpp/bindings/binding.h" |
| 13 |
| 14 namespace extensions { |
| 15 |
| 16 class WiFiDisplaySession: public DisplaySourceSession, |
| 17 public WiFiDisplaySessionServiceClient { |
| 18 public: |
| 19 explicit WiFiDisplaySession( |
| 20 const DisplaySourceSessionParams& params); |
| 21 ~WiFiDisplaySession() override; |
| 22 |
| 23 private: |
| 24 // DisplaySourceSession overrides. |
| 25 void Start() override; |
| 26 void Terminate() override; |
| 27 |
| 28 // WiFiDisplaySessionServiceClient overrides. |
| 29 void OnConnected(int32_t sink_id, |
| 30 const mojo::String& ip_address) override; |
| 31 void OnDisconnected(int32_t sink_id) override; |
| 32 void OnError(int32_t sink_id, |
| 33 int32_t type, |
| 34 const mojo::String& description) override; |
| 35 void OnMessage(const mojo::String& data) override; |
| 36 |
| 37 // A connection error handler for the mojo objects used in this class. |
| 38 void OnConnectionError(); |
| 39 |
| 40 private: |
| 41 WiFiDisplaySessionServicePtr service_; |
| 42 mojo::Binding<WiFiDisplaySessionServiceClient> binding_; |
| 43 std::string ip_address_; |
| 44 DisplaySourceSessionParams params_; |
| 45 base::WeakPtrFactory<WiFiDisplaySession> weak_factory_; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(WiFiDisplaySession); |
| 48 }; |
| 49 |
| 50 } // namespace extensions |
| 51 |
| 52 #endif // EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESS
ION_H_ |
OLD | NEW |