diff options
Diffstat (limited to 'components/copresence/copresence_manager_impl.cc')
-rw-r--r-- | components/copresence/copresence_manager_impl.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/components/copresence/copresence_manager_impl.cc b/components/copresence/copresence_manager_impl.cc index 265b042..2d5828a 100644 --- a/components/copresence/copresence_manager_impl.cc +++ b/components/copresence/copresence_manager_impl.cc @@ -10,6 +10,7 @@ #include "base/strings/stringprintf.h" #include "base/timer/timer.h" #include "components/copresence/handlers/directive_handler.h" +#include "components/copresence/handlers/gcm_handler.h" #include "components/copresence/proto/rpcs.pb.h" #include "components/copresence/public/whispernet_client.h" #include "components/copresence/rpc/rpc_handler.h" @@ -31,16 +32,22 @@ CopresenceManagerImpl::CopresenceManagerImpl(CopresenceDelegate* delegate) &CopresenceManagerImpl::WhispernetInitComplete, // This callback gets cancelled when we are destroyed. base::Unretained(this))), + init_failed_(false), directive_handler_(new DirectiveHandler), poll_timer_(new base::RepeatingTimer<CopresenceManagerImpl>), - audio_check_timer_(new base::RepeatingTimer<CopresenceManagerImpl>), - init_failed_(false) { + audio_check_timer_(new base::RepeatingTimer<CopresenceManagerImpl>) { DCHECK(delegate_); DCHECK(delegate_->GetWhispernetClient()); delegate_->GetWhispernetClient()->Initialize( whispernet_init_callback_.callback()); - rpc_handler_.reset(new RpcHandler(delegate_, directive_handler_.get())); + if (delegate->GetGCMDriver()) + gcm_handler_.reset(new GCMHandler(delegate->GetGCMDriver(), + directive_handler_.get())); + + rpc_handler_.reset(new RpcHandler(delegate, + directive_handler_.get(), + gcm_handler_.get())); } CopresenceManagerImpl::~CopresenceManagerImpl() { |