| Index: blimp/client/core/context/blimp_client_context_impl.cc
|
| diff --git a/blimp/client/core/context/blimp_client_context_impl.cc b/blimp/client/core/context/blimp_client_context_impl.cc
|
| index e9eda6ae2de473637f806adc9f7556721a620a36..b8278ecfe3b0628a4417df974ec42df1da24f9e2 100644
|
| --- a/blimp/client/core/context/blimp_client_context_impl.cc
|
| +++ b/blimp/client/core/context/blimp_client_context_impl.cc
|
| @@ -108,6 +108,8 @@ BlimpClientContextImpl::BlimpClientContextImpl(
|
| RegisterFeatures();
|
| InitializeSettings();
|
|
|
| + connection_status_.AddObserver(this);
|
| +
|
| // Initialize must only be posted after the features have been
|
| // registered.
|
| io_thread_task_runner_->PostTask(
|
| @@ -119,6 +121,7 @@ BlimpClientContextImpl::BlimpClientContextImpl(
|
|
|
| BlimpClientContextImpl::~BlimpClientContextImpl() {
|
| io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release());
|
| + connection_status_.RemoveObserver(this);
|
| }
|
|
|
| void BlimpClientContextImpl::SetDelegate(BlimpClientContextDelegate* delegate) {
|
| @@ -254,5 +257,21 @@ void BlimpClientContextImpl::OnImageDecodeError() {
|
| DropConnection();
|
| }
|
|
|
| +void BlimpClientContextImpl::OnConnected() {
|
| + if (delegate_) {
|
| + delegate_->OnConnected();
|
| + }
|
| +}
|
| +
|
| +void BlimpClientContextImpl::OnDisconnected(int result) {
|
| + if (delegate_) {
|
| + if (result >= 0) {
|
| + delegate_->OnEngineDisconnected(result);
|
| + } else {
|
| + delegate_->OnNetworkDisconnected(result);
|
| + }
|
| + }
|
| +}
|
| +
|
| } // namespace client
|
| } // namespace blimp
|
|
|