Index: google_apis/gcm/gcm_client_impl.cc |
diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc |
index b5a3ae6e5c15b4fed6a296193b57144d18429583..6f7dbb78d72db664817bc99ac3e3f5c5fb7e863f 100644 |
--- a/google_apis/gcm/gcm_client_impl.cc |
+++ b/google_apis/gcm/gcm_client_impl.cc |
@@ -341,6 +341,7 @@ void GCMClientImpl::InitializeMCSClient( |
network_session_, |
net_log_.net_log(), |
&recorder_); |
+ connection_factory_->SetConnectionListener(this); |
mcs_client_ = internals_builder_->BuildMCSClient( |
chrome_build_info_.version, |
clock_.get(), |
@@ -711,8 +712,9 @@ GCMClient::GCMStatistics GCMClientImpl::GetStatistics() const { |
stats.is_recording = recorder_.is_recording(); |
stats.gcm_client_state = GetStateString(); |
stats.connection_client_created = mcs_client_.get() != NULL; |
+ if (connection_factory_.get()) |
+ stats.connection_state = connection_factory_->GetConnectionStateString(); |
if (mcs_client_.get()) { |
- stats.connection_state = mcs_client_->GetStateString(); |
stats.send_queue_size = mcs_client_->GetSendQueueSize(); |
stats.resend_queue_size = mcs_client_->GetResendQueueSize(); |
} |
@@ -731,6 +733,17 @@ void GCMClientImpl::OnActivityRecorded() { |
delegate_->OnActivityRecorded(); |
} |
+void GCMClientImpl::OnConnected(const GURL& current_endpoint, |
+ const net::IPEndPoint& socket_ip) { |
+ // TODO(zea): inform GCMClient::Delegate and app handlers as well. |
+ delegate_->OnActivityRecorded(); |
+} |
+ |
+void GCMClientImpl::OnDisconnected() { |
+ // TODO(zea): inform GCMClient::Delegate and app handlers as well. |
+ delegate_->OnActivityRecorded(); |
+} |
+ |
void GCMClientImpl::OnMessageReceivedFromMCS(const gcm::MCSMessage& message) { |
switch (message.tag()) { |
case kLoginResponseTag: |