| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/host_change_notification_listener.h" | 5 #include "remoting/host/host_change_notification_listener.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 HostChangeNotificationListener::HostChangeNotificationListener( | 23 HostChangeNotificationListener::HostChangeNotificationListener( |
| 24 Listener* listener, | 24 Listener* listener, |
| 25 const std::string& host_id, | 25 const std::string& host_id, |
| 26 SignalStrategy* signal_strategy, | 26 SignalStrategy* signal_strategy, |
| 27 const std::string& directory_bot_jid) | 27 const std::string& directory_bot_jid) |
| 28 : listener_(listener), | 28 : listener_(listener), |
| 29 host_id_(host_id), | 29 host_id_(host_id), |
| 30 signal_strategy_(signal_strategy), | 30 signal_strategy_(signal_strategy), |
| 31 directory_bot_jid_(directory_bot_jid), | 31 directory_bot_jid_(directory_bot_jid), |
| 32 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 32 weak_factory_(this) { |
| 33 DCHECK(signal_strategy_); | 33 DCHECK(signal_strategy_); |
| 34 | 34 |
| 35 signal_strategy_->AddListener(this); | 35 signal_strategy_->AddListener(this); |
| 36 } | 36 } |
| 37 | 37 |
| 38 HostChangeNotificationListener::~HostChangeNotificationListener() { | 38 HostChangeNotificationListener::~HostChangeNotificationListener() { |
| 39 signal_strategy_->RemoveListener(this); | 39 signal_strategy_->RemoveListener(this); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void HostChangeNotificationListener::OnSignalStrategyStateChange( | 42 void HostChangeNotificationListener::OnSignalStrategyStateChange( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 73 LOG(ERROR) << "Invalid host-changed message received: " << stanza->Str(); | 73 LOG(ERROR) << "Invalid host-changed message received: " << stanza->Str(); |
| 74 } | 74 } |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void HostChangeNotificationListener::OnHostDeleted() { | 78 void HostChangeNotificationListener::OnHostDeleted() { |
| 79 listener_->OnHostDeleted(); | 79 listener_->OnHostDeleted(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace remoting | 82 } // namespace remoting |
| OLD | NEW |