Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: chrome/browser/policy/cloud/user_cloud_policy_invalidator_factory.cc

Issue 206133006: Remove disable-cloud-policy-push flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
8 #include "chrome/browser/invalidation/invalidation_service_factory.h" 7 #include "chrome/browser/invalidation/invalidation_service_factory.h"
9 #include "chrome/browser/policy/cloud/user_cloud_policy_invalidator.h" 8 #include "chrome/browser/policy/cloud/user_cloud_policy_invalidator.h"
10 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" 10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 #include "components/policy/core/common/policy_switches.h"
13 #if defined(OS_CHROMEOS) 11 #if defined(OS_CHROMEOS)
14 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 12 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
15 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h" 13 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h"
16 #else 14 #else
17 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" 15 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
18 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" 16 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
19 #endif 17 #endif
20 18
21 namespace policy { 19 namespace policy {
22 20
(...skipping 12 matching lines...) Expand all
35 DependsOn(UserCloudPolicyManagerFactoryChromeOS::GetInstance()); 33 DependsOn(UserCloudPolicyManagerFactoryChromeOS::GetInstance());
36 #else 34 #else
37 DependsOn(UserCloudPolicyManagerFactory::GetInstance()); 35 DependsOn(UserCloudPolicyManagerFactory::GetInstance());
38 #endif 36 #endif
39 } 37 }
40 38
41 UserCloudPolicyInvalidatorFactory::~UserCloudPolicyInvalidatorFactory() {} 39 UserCloudPolicyInvalidatorFactory::~UserCloudPolicyInvalidatorFactory() {}
42 40
43 KeyedService* UserCloudPolicyInvalidatorFactory::BuildServiceInstanceFor( 41 KeyedService* UserCloudPolicyInvalidatorFactory::BuildServiceInstanceFor(
44 content::BrowserContext* context) const { 42 content::BrowserContext* context) const {
45 if (CommandLine::ForCurrentProcess()->HasSwitch(
46 switches::kDisableCloudPolicyPush)) {
47 return NULL;
48 }
49
50 Profile* profile = static_cast<Profile*>(context); 43 Profile* profile = static_cast<Profile*>(context);
51 #if defined(OS_CHROMEOS) 44 #if defined(OS_CHROMEOS)
52 CloudPolicyManager* policy_manager = 45 CloudPolicyManager* policy_manager =
53 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile); 46 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile);
54 #else 47 #else
55 CloudPolicyManager* policy_manager = 48 CloudPolicyManager* policy_manager =
56 UserCloudPolicyManagerFactory::GetForBrowserContext(context); 49 UserCloudPolicyManagerFactory::GetForBrowserContext(context);
57 #endif 50 #endif
58 if (!policy_manager) 51 if (!policy_manager)
59 return NULL; 52 return NULL;
60 53
61 return new UserCloudPolicyInvalidator(profile, policy_manager); 54 return new UserCloudPolicyInvalidator(profile, policy_manager);
62 } 55 }
63 56
64 bool UserCloudPolicyInvalidatorFactory:: 57 bool UserCloudPolicyInvalidatorFactory::
65 ServiceIsCreatedWithBrowserContext() const { 58 ServiceIsCreatedWithBrowserContext() const {
66 // Must be automatically created to enable user policy invalidations. 59 // Must be automatically created to enable user policy invalidations.
67 return true; 60 return true;
68 } 61 }
69 62
70 bool UserCloudPolicyInvalidatorFactory::ServiceIsNULLWhileTesting() const { 63 bool UserCloudPolicyInvalidatorFactory::ServiceIsNULLWhileTesting() const {
71 // Not used in tests. 64 // Not used in tests.
72 return true; 65 return true;
73 } 66 }
74 67
75 } // namespace policy 68 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698