OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
6 #define CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 6 #define CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 13 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
14 | 14 |
15 #if defined(OS_CHROMEOS) | 15 #if defined(OS_CHROMEOS) |
16 #include "chromeos/dbus/dbus_method_call_status.h" | 16 #include "chromeos/dbus/dbus_method_call_status.h" |
17 #endif | 17 #endif |
18 | 18 |
19 class Profile; | 19 class Profile; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class SequencedTaskRunner; | 22 class SequencedTaskRunner; |
23 } | 23 } |
24 | 24 |
25 namespace policy { | 25 namespace policy { |
26 | 26 |
27 class DeviceLocalAccountPolicyProvider; | 27 class ConfigurationPolicyProvider; |
28 class ManagedModePolicyProvider; | 28 class ManagedModePolicyProvider; |
29 class PolicyService; | 29 class PolicyService; |
30 | 30 |
31 // A BrowserContextKeyedService that creates and manages the per-Profile policy | 31 // A BrowserContextKeyedService that creates and manages the per-Profile policy |
32 // components. | 32 // components. |
33 class ProfilePolicyConnector : public BrowserContextKeyedService { | 33 class ProfilePolicyConnector : public BrowserContextKeyedService { |
34 public: | 34 public: |
35 explicit ProfilePolicyConnector(Profile* profile); | 35 explicit ProfilePolicyConnector(Profile* profile); |
36 virtual ~ProfilePolicyConnector(); | 36 virtual ~ProfilePolicyConnector(); |
37 | 37 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 Profile* profile_; | 75 Profile* profile_; |
76 | 76 |
77 #if defined(OS_CHROMEOS) | 77 #if defined(OS_CHROMEOS) |
78 // Some of the user policy configuration affects browser global state, and | 78 // Some of the user policy configuration affects browser global state, and |
79 // can only come from one Profile. |is_primary_user_| is true if this | 79 // can only come from one Profile. |is_primary_user_| is true if this |
80 // connector belongs to the first signed-in Profile, and in that case that | 80 // connector belongs to the first signed-in Profile, and in that case that |
81 // Profile's policy is the one that affects global policy settings in | 81 // Profile's policy is the one that affects global policy settings in |
82 // local state. | 82 // local state. |
83 bool is_primary_user_; | 83 bool is_primary_user_; |
84 | 84 |
85 scoped_ptr<DeviceLocalAccountPolicyProvider> | 85 scoped_ptr<ConfigurationPolicyProvider> special_user_policy_provider_; |
86 device_local_account_policy_provider_; | |
87 #endif | 86 #endif |
88 | 87 |
89 #if defined(ENABLE_MANAGED_USERS) && defined(ENABLE_CONFIGURATION_POLICY) | 88 #if defined(ENABLE_MANAGED_USERS) && defined(ENABLE_CONFIGURATION_POLICY) |
90 scoped_ptr<ManagedModePolicyProvider> managed_mode_policy_provider_; | 89 scoped_ptr<ManagedModePolicyProvider> managed_mode_policy_provider_; |
91 #endif | 90 #endif |
92 | 91 |
93 base::WeakPtrFactory<ProfilePolicyConnector> weak_ptr_factory_; | 92 base::WeakPtrFactory<ProfilePolicyConnector> weak_ptr_factory_; |
94 #endif // ENABLE_CONFIGURATION_POLICY | 93 #endif // ENABLE_CONFIGURATION_POLICY |
95 | 94 |
96 scoped_ptr<PolicyService> policy_service_; | 95 scoped_ptr<PolicyService> policy_service_; |
97 | 96 |
98 DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnector); | 97 DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnector); |
99 }; | 98 }; |
100 | 99 |
101 } // namespace policy | 100 } // namespace policy |
102 | 101 |
103 #endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 102 #endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
OLD | NEW |