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_factory.h" | 5 #include "chrome/browser/policy/cloud/user_cloud_policy_invalidator_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/invalidation/invalidation_service_factory.h" | 8 #include "chrome/browser/invalidation/invalidation_service_factory.h" |
9 #include "chrome/browser/policy/cloud/user_cloud_policy_invalidator.h" | 9 #include "chrome/browser/policy/cloud/user_cloud_policy_invalidator.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 switches::kDisableCloudPolicyPush)) { | 47 switches::kDisableCloudPolicyPush)) { |
48 return NULL; | 48 return NULL; |
49 } | 49 } |
50 | 50 |
51 Profile* profile = static_cast<Profile*>(context); | 51 Profile* profile = static_cast<Profile*>(context); |
52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
53 CloudPolicyManager* policy_manager = | 53 CloudPolicyManager* policy_manager = |
54 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile); | 54 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile); |
55 #else | 55 #else |
56 CloudPolicyManager* policy_manager = | 56 CloudPolicyManager* policy_manager = |
57 UserCloudPolicyManagerFactory::GetForProfile(profile); | 57 UserCloudPolicyManagerFactory::GetForBrowserContext(context); |
58 #endif | 58 #endif |
59 if (!policy_manager) | 59 if (!policy_manager) |
60 return NULL; | 60 return NULL; |
61 | 61 |
62 return new UserCloudPolicyInvalidator(profile, policy_manager); | 62 return new UserCloudPolicyInvalidator(profile, policy_manager); |
63 } | 63 } |
64 | 64 |
65 bool UserCloudPolicyInvalidatorFactory:: | 65 bool UserCloudPolicyInvalidatorFactory:: |
66 ServiceIsCreatedWithBrowserContext() const { | 66 ServiceIsCreatedWithBrowserContext() const { |
67 // Must be automatically created to enable user policy invalidations. | 67 // Must be automatically created to enable user policy invalidations. |
68 return true; | 68 return true; |
69 } | 69 } |
70 | 70 |
71 bool UserCloudPolicyInvalidatorFactory::ServiceIsNULLWhileTesting() const { | 71 bool UserCloudPolicyInvalidatorFactory::ServiceIsNULLWhileTesting() const { |
72 // Not used in tests. | 72 // Not used in tests. |
73 return true; | 73 return true; |
74 } | 74 } |
75 | 75 |
76 } // namespace policy | 76 } // namespace policy |
OLD | NEW |