| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/policy/cloud/user_cloud_policy_invalidator.h" | 5 #include "chrome/browser/policy/cloud/user_cloud_policy_invalidator.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void UserCloudPolicyInvalidator::Shutdown() { | 57 void UserCloudPolicyInvalidator::Shutdown() { |
| 58 CloudPolicyInvalidator::Shutdown(); | 58 CloudPolicyInvalidator::Shutdown(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void UserCloudPolicyInvalidator::Observe( | 61 void UserCloudPolicyInvalidator::Observe( |
| 62 int type, | 62 int type, |
| 63 const content::NotificationSource& source, | 63 const content::NotificationSource& source, |
| 64 const content::NotificationDetails& details) { | 64 const content::NotificationDetails& details) { |
| 65 // Initialize now that profile creation is complete and the invalidation | 65 // Initialize now that profile creation is complete and the invalidation |
| 66 // service can safely be initialized. | 66 // service can safely be initialized. |
| 67 DCHECK(type == chrome::NOTIFICATION_PROFILE_ADDED); | 67 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_ADDED, type); |
| 68 invalidation::ProfileInvalidationProvider* invalidation_provider = | 68 invalidation::ProfileInvalidationProvider* invalidation_provider = |
| 69 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile_); | 69 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile_); |
| 70 if (invalidation_provider) | 70 if (invalidation_provider) |
| 71 Initialize(invalidation_provider->GetInvalidationService()); | 71 Initialize(invalidation_provider->GetInvalidationService()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace policy | 74 } // namespace policy |
| OLD | NEW |