OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" | 5 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 DCHECK_EQ(chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, type); | 147 DCHECK_EQ(chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, type); |
148 DCHECK(!is_shut_down_); | 148 DCHECK(!is_shut_down_); |
149 Profile* profile = content::Details<Profile>(details).ptr(); | 149 Profile* profile = content::Details<Profile>(details).ptr(); |
150 invalidation::ProfileInvalidationProvider* invalidation_provider = | 150 invalidation::ProfileInvalidationProvider* invalidation_provider = |
151 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile); | 151 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile); |
152 if (!invalidation_provider) { | 152 if (!invalidation_provider) { |
153 // If the Profile does not support invalidation (e.g. guest, incognito), | 153 // If the Profile does not support invalidation (e.g. guest, incognito), |
154 // ignore it. | 154 // ignore it. |
155 return; | 155 return; |
156 } | 156 } |
157 user_manager::User* user = | 157 const user_manager::User* user = |
158 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 158 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
159 if (!user || | 159 if (!user || |
160 g_browser_process->platform_part()->browser_policy_connector_chromeos()-> | 160 g_browser_process->platform_part()->browser_policy_connector_chromeos()-> |
161 GetUserAffiliation(user->email()) != USER_AFFILIATION_MANAGED) { | 161 GetUserAffiliation(user->email()) != USER_AFFILIATION_MANAGED) { |
162 // If the Profile belongs to a user who is not affiliated with the device's | 162 // If the Profile belongs to a user who is not affiliated with the device's |
163 // enrollment domain, ignore it. | 163 // enrollment domain, ignore it. |
164 return; | 164 return; |
165 } | 165 } |
166 | 166 |
167 // Create a state observer for the user's invalidation service. | 167 // Create a state observer for the user's invalidation service. |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 OnInvalidationServiceSet(invalidation_service_)); | 339 OnInvalidationServiceSet(invalidation_service_)); |
340 } | 340 } |
341 | 341 |
342 void | 342 void |
343 AffiliatedInvalidationServiceProviderImpl::DestroyDeviceInvalidationService() { | 343 AffiliatedInvalidationServiceProviderImpl::DestroyDeviceInvalidationService() { |
344 device_invalidation_service_observer_.reset(); | 344 device_invalidation_service_observer_.reset(); |
345 device_invalidation_service_.reset(); | 345 device_invalidation_service_.reset(); |
346 } | 346 } |
347 | 347 |
348 } // namespace policy | 348 } // namespace policy |
OLD | NEW |