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 #include "extensions/renderer/api/display_source/display_source_session.h" | 5 #include "extensions/renderer/api/display_source/display_source_session.h" |
6 | 6 |
| 7 #if defined(ENABLE_WIFI_DISPLAY) |
| 8 #include "extensions/renderer/api/display_source/wifi_display/wifi_display_sessi
on.h" |
| 9 #endif |
| 10 |
7 namespace extensions { | 11 namespace extensions { |
8 | 12 |
9 DisplaySourceSession::DisplaySourceSession() | 13 DisplaySourceSessionParams::DisplaySourceSessionParams() |
10 : state_(Idle) { | 14 : auth_method(api::display_source::AUTHENTICATION_METHOD_NONE) { |
11 } | 15 } |
12 | 16 |
13 DisplaySourceSession::~DisplaySourceSession() { | 17 DisplaySourceSessionParams::~DisplaySourceSessionParams() = default; |
| 18 |
| 19 DisplaySourceSession::DisplaySourceSession() |
| 20 : state_(Idle) { |
14 } | 21 } |
15 | 22 |
| 23 DisplaySourceSession::~DisplaySourceSession() = default; |
| 24 |
16 void DisplaySourceSession::SetCallbacks( | 25 void DisplaySourceSession::SetCallbacks( |
17 const SinkIdCallback& started_callback, | 26 const SinkIdCallback& started_callback, |
18 const SinkIdCallback& terminated_callback, | 27 const SinkIdCallback& terminated_callback, |
19 const ErrorCallback& error_callback) { | 28 const ErrorCallback& error_callback) { |
20 DCHECK(started_callback_.is_null()); | 29 DCHECK(started_callback_.is_null()); |
21 DCHECK(terminated_callback_.is_null()); | 30 DCHECK(terminated_callback_.is_null()); |
22 DCHECK(error_callback_.is_null()); | 31 DCHECK(error_callback_.is_null()); |
23 | 32 |
24 started_callback_ = started_callback; | 33 started_callback_ = started_callback; |
25 terminated_callback_ = terminated_callback; | 34 terminated_callback_ = terminated_callback; |
26 error_callback_ = error_callback; | 35 error_callback_ = error_callback; |
27 } | 36 } |
28 | 37 |
29 scoped_ptr<DisplaySourceSession> DisplaySourceSessionFactory::CreateSession( | 38 scoped_ptr<DisplaySourceSession> DisplaySourceSessionFactory::CreateSession( |
30 int sink_id, | 39 const DisplaySourceSessionParams& params) { |
31 const blink::WebMediaStreamTrack& video_track, | 40 #if defined(ENABLE_WIFI_DISPLAY) |
32 const blink::WebMediaStreamTrack& audio_track, | 41 return scoped_ptr<DisplaySourceSession>(new WiFiDisplaySession(params)); |
33 scoped_ptr<DisplaySourceAuthInfo> auth_info) { | 42 #endif |
34 return nullptr; | 43 return nullptr; |
35 } | 44 } |
36 | 45 |
37 } // namespace extensions | 46 } // namespace extensions |
OLD | NEW |