OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
6 #define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 6 #define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/task.h" | 13 #include "base/task.h" |
| 14 #include "chrome/browser/policy/enterprise_install_attributes.h" |
14 | 15 |
15 class PrefService; | 16 class PrefService; |
16 class TestingBrowserProcess; | 17 class TestingBrowserProcess; |
17 class TokenService; | 18 class TokenService; |
18 | 19 |
19 namespace net { | 20 namespace net { |
20 class URLRequestContextGetter; | 21 class URLRequestContextGetter; |
21 } | 22 } |
22 | 23 |
23 namespace policy { | 24 namespace policy { |
(...skipping 23 matching lines...) Expand all Loading... |
47 | 48 |
48 // Used to set the credentials stored in the identity strategy associated | 49 // Used to set the credentials stored in the identity strategy associated |
49 // with this policy connector. | 50 // with this policy connector. |
50 void SetCredentials(const std::string& owner_email, | 51 void SetCredentials(const std::string& owner_email, |
51 const std::string& gaia_token); | 52 const std::string& gaia_token); |
52 | 53 |
53 // Returns true if this device is managed by an enterprise (as opposed to | 54 // Returns true if this device is managed by an enterprise (as opposed to |
54 // a local owner). | 55 // a local owner). |
55 bool IsEnterpriseManaged(); | 56 bool IsEnterpriseManaged(); |
56 | 57 |
| 58 // Locks the device to an enterprise domain. |
| 59 EnterpriseInstallAttributes::LockResult LockDevice(const std::string& user); |
| 60 |
57 // Returns the enterprise domain if device is managed. | 61 // Returns the enterprise domain if device is managed. |
58 std::string GetEnterpriseDomain(); | 62 std::string GetEnterpriseDomain(); |
59 | 63 |
60 // Exposes the StopAutoRetry() method of the CloudPolicySubsystem managed | 64 // Exposes the StopAutoRetry() method of the CloudPolicySubsystem managed |
61 // by this connector, which can be used to disable automatic | 65 // by this connector, which can be used to disable automatic |
62 // retrying behavior. | 66 // retrying behavior. |
63 void StopAutoRetry(); | 67 void StopAutoRetry(); |
64 | 68 |
65 private: | 69 private: |
66 friend class ::TestingBrowserProcess; | 70 friend class ::TestingBrowserProcess; |
67 | 71 |
68 static ConfigurationPolicyProvider* CreateManagedPlatformProvider(); | 72 static ConfigurationPolicyProvider* CreateManagedPlatformProvider(); |
69 static ConfigurationPolicyProvider* CreateRecommendedPlatformProvider(); | 73 static ConfigurationPolicyProvider* CreateRecommendedPlatformProvider(); |
70 | 74 |
71 // Constructor for tests that allows tests to use fake platform policy | 75 // Constructor for tests that allows tests to use fake platform policy |
72 // providers instead of using the actual ones. | 76 // providers instead of using the actual ones. |
73 BrowserPolicyConnector( | 77 BrowserPolicyConnector( |
74 ConfigurationPolicyProvider* managed_platform_provider, | 78 ConfigurationPolicyProvider* managed_platform_provider, |
75 ConfigurationPolicyProvider* recommended_platform_provider); | 79 ConfigurationPolicyProvider* recommended_platform_provider); |
76 | 80 |
77 // Activates the cloud policy subsystem. | 81 // Activates the cloud policy subsystem. |
78 void Initialize(); | 82 void Initialize(); |
79 | 83 |
80 scoped_ptr<ConfigurationPolicyProvider> managed_platform_provider_; | 84 scoped_ptr<ConfigurationPolicyProvider> managed_platform_provider_; |
81 scoped_ptr<ConfigurationPolicyProvider> recommended_platform_provider_; | 85 scoped_ptr<ConfigurationPolicyProvider> recommended_platform_provider_; |
82 | 86 |
83 #if defined(OS_CHROMEOS) | 87 #if defined(OS_CHROMEOS) |
84 scoped_ptr<DevicePolicyIdentityStrategy> identity_strategy_; | 88 scoped_ptr<DevicePolicyIdentityStrategy> identity_strategy_; |
| 89 scoped_ptr<EnterpriseInstallAttributes> install_attributes_; |
85 #endif | 90 #endif |
86 scoped_ptr<CloudPolicySubsystem> cloud_policy_subsystem_; | 91 scoped_ptr<CloudPolicySubsystem> cloud_policy_subsystem_; |
87 | 92 |
88 ScopedRunnableMethodFactory<BrowserPolicyConnector> method_factory_; | 93 ScopedRunnableMethodFactory<BrowserPolicyConnector> method_factory_; |
89 | 94 |
90 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); | 95 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); |
91 }; | 96 }; |
92 | 97 |
93 } // namespace policy | 98 } // namespace policy |
94 | 99 |
95 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 100 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
OLD | NEW |