OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/host/it2me_host_user_interface.h" | 5 #include "remoting/host/it2me_host_user_interface.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "remoting/host/chromoting_host.h" | 8 #include "remoting/host/chromoting_host.h" |
9 #include "remoting/host/chromoting_host_context.h" | 9 #include "remoting/host/chromoting_host_context.h" |
10 #include "remoting/host/continue_window.h" | 10 #include "remoting/host/continue_window.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 It2MeHostUserInterface::~It2MeHostUserInterface() { | 38 It2MeHostUserInterface::~It2MeHostUserInterface() { |
39 } | 39 } |
40 | 40 |
41 void It2MeHostUserInterface::Init() { | 41 void It2MeHostUserInterface::Init() { |
42 InitFrom(DisconnectWindow::Create(), | 42 InitFrom(DisconnectWindow::Create(), |
43 ContinueWindow::Create(), | 43 ContinueWindow::Create(), |
44 LocalInputMonitor::Create()); | 44 LocalInputMonitor::Create()); |
45 } | 45 } |
46 | 46 |
47 void It2MeHostUserInterface::InitFrom(DisconnectWindow* disconnect_window, | 47 void It2MeHostUserInterface::InitFrom( |
48 ContinueWindow* continue_window, | 48 scoped_ptr<DisconnectWindow> disconnect_window, |
49 LocalInputMonitor* monitor) { | 49 scoped_ptr<ContinueWindow> continue_window, |
50 disconnect_window_.reset(disconnect_window); | 50 scoped_ptr<LocalInputMonitor> monitor) { |
51 continue_window_.reset(continue_window); | 51 disconnect_window_ = disconnect_window.Pass(); |
52 local_input_monitor_.reset(monitor); | 52 continue_window_ = continue_window.Pass(); |
| 53 local_input_monitor_ = monitor.Pass(); |
53 host_->AddStatusObserver(this); | 54 host_->AddStatusObserver(this); |
54 } | 55 } |
55 | 56 |
56 void It2MeHostUserInterface::OnClientAuthenticated(const std::string& jid) { | 57 void It2MeHostUserInterface::OnClientAuthenticated(const std::string& jid) { |
57 if (!authenticated_jid_.empty()) { | 58 if (!authenticated_jid_.empty()) { |
58 // If we already authenticated another client then one of the | 59 // If we already authenticated another client then one of the |
59 // connections may be an attacker, so both are suspect and we have | 60 // connections may be an attacker, so both are suspect and we have |
60 // to reject the second connection and shutdown the host. | 61 // to reject the second connection and shutdown the host. |
61 host_->RejectAuthenticatingClient(); | 62 host_->RejectAuthenticatingClient(); |
62 context_->network_message_loop()->PostTask(FROM_HERE, base::Bind( | 63 context_->network_message_loop()->PostTask(FROM_HERE, base::Bind( |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 194 } |
194 | 195 |
195 void It2MeHostUserInterface::OnShutdownHostTimer() { | 196 void It2MeHostUserInterface::OnShutdownHostTimer() { |
196 DCHECK(context_->ui_message_loop()->BelongsToCurrentThread()); | 197 DCHECK(context_->ui_message_loop()->BelongsToCurrentThread()); |
197 | 198 |
198 ShowContinueWindow(false); | 199 ShowContinueWindow(false); |
199 host_->Shutdown(base::Closure()); | 200 host_->Shutdown(base::Closure()); |
200 } | 201 } |
201 | 202 |
202 } // namespace remoting | 203 } // namespace remoting |
OLD | NEW |