Index: components/gcm_driver/instance_id/instance_id_impl.cc |
diff --git a/components/gcm_driver/instance_id/instance_id_impl.cc b/components/gcm_driver/instance_id/instance_id_impl.cc |
index 74c708a560ac0f07ae46f9e6bb3b6a89d5076b30..90a59513238fcad175df720026128fac18bb4f48 100644 |
--- a/components/gcm_driver/instance_id/instance_id_impl.cc |
+++ b/components/gcm_driver/instance_id/instance_id_impl.cc |
@@ -49,14 +49,19 @@ InstanceID::Result GCMClientResultToInstanceIDResult( |
} // namespace |
// static |
-std::unique_ptr<InstanceID> InstanceID::Create(const std::string& app_id, |
- gcm::GCMDriver* gcm_driver) { |
- return base::WrapUnique(new InstanceIDImpl(app_id, gcm_driver)); |
+std::unique_ptr<InstanceID> InstanceID::CreateInternal( |
+ const std::string& app_id, |
+ bool use_subtype, |
+ gcm::GCMDriver* gcm_driver) { |
+ return base::WrapUnique(new InstanceIDImpl(app_id, use_subtype, gcm_driver)); |
} |
InstanceIDImpl::InstanceIDImpl(const std::string& app_id, |
+ bool use_subtype, |
gcm::GCMDriver* gcm_driver) |
- : InstanceID(app_id, gcm_driver), weak_ptr_factory_(this) { |
+ : InstanceID(app_id, gcm_driver), |
+ use_subtype_(use_subtype), |
+ weak_ptr_factory_(this) { |
Handler()->GetInstanceIDData( |
app_id, base::Bind(&InstanceIDImpl::GetInstanceIDDataCompleted, |
weak_ptr_factory_.GetWeakPtr())); |
@@ -128,7 +133,7 @@ void InstanceIDImpl::DoGetToken( |
const GetTokenCallback& callback) { |
EnsureIDGenerated(); |
- Handler()->GetToken(app_id(), authorized_entity, scope, options, |
+ Handler()->GetToken(app_id(), use_subtype_, authorized_entity, scope, options, |
base::Bind(&InstanceIDImpl::OnGetTokenCompleted, |
weak_ptr_factory_.GetWeakPtr(), callback)); |
} |
@@ -162,9 +167,9 @@ void InstanceIDImpl::DoDeleteToken( |
return; |
} |
- Handler()->DeleteToken(app_id(), authorized_entity, scope, |
- base::Bind(&InstanceIDImpl::OnDeleteTokenCompleted, |
- weak_ptr_factory_.GetWeakPtr(), callback)); |
+ Handler()->DeleteToken(app_id(), use_subtype_, authorized_entity, scope, |
+ base::Bind(&InstanceIDImpl::OnDeleteTokenCompleted, |
+ weak_ptr_factory_.GetWeakPtr(), callback)); |
} |
void InstanceIDImpl::DeleteIDImpl(const DeleteIDCallback& callback) { |
@@ -187,8 +192,9 @@ void InstanceIDImpl::DoDeleteID(const DeleteIDCallback& callback) { |
} |
Handler()->DeleteAllTokensForApp( |
- app_id(), base::Bind(&InstanceIDImpl::OnDeleteIDCompleted, |
- weak_ptr_factory_.GetWeakPtr(), callback)); |
+ app_id(), use_subtype_, |
+ base::Bind(&InstanceIDImpl::OnDeleteIDCompleted, |
+ weak_ptr_factory_.GetWeakPtr(), callback)); |
Handler()->RemoveInstanceIDData(app_id()); |