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