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

Side by Side Diff: chrome/browser/policy/browser_policy_connector.h

Issue 60823003: Introduced a ForwardingPolicyProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed unittest when enable_extensions=0 Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 7
8 #include <string> 8 #include <string>
9 #include <vector>
10 9
11 #include "base/basictypes.h" 10 #include "base/basictypes.h"
12 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
15 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" 14 #include "chrome/browser/policy/cloud/cloud_policy_constants.h"
16 #include "chrome/browser/policy/configuration_policy_handler_list.h" 15 #include "chrome/browser/policy/configuration_policy_handler_list.h"
17 #include "chrome/browser/policy/schema_registry.h" 16 #include "chrome/browser/policy/schema_registry.h"
18 #include "components/policy/core/common/schema.h" 17 #include "components/policy/core/common/schema.h"
19 18
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 bool is_initialized() const { return is_initialized_; } 68 bool is_initialized() const { return is_initialized_; }
70 69
71 // Returns a handle to the Chrome schema. 70 // Returns a handle to the Chrome schema.
72 const Schema& GetChromeSchema() const; 71 const Schema& GetChromeSchema() const;
73 72
74 // Returns the global CombinedSchemaRegistry. SchemaRegistries from Profiles 73 // Returns the global CombinedSchemaRegistry. SchemaRegistries from Profiles
75 // should be tracked by the global registry, so that the global policy 74 // should be tracked by the global registry, so that the global policy
76 // providers also load policies for the components of each Profile. 75 // providers also load policies for the components of each Profile.
77 CombinedSchemaRegistry* GetSchemaRegistry(); 76 CombinedSchemaRegistry* GetSchemaRegistry();
78 77
78 // Returns the platform policy provider.
79 ConfigurationPolicyProvider* GetPlatformProvider();
80
79 // Returns the browser-global PolicyService, that contains policies for the 81 // Returns the browser-global PolicyService, that contains policies for the
80 // whole browser. 82 // whole browser.
81 PolicyService* GetPolicyService(); 83 PolicyService* GetPolicyService();
82 84
83 #if defined(OS_CHROMEOS) 85 #if defined(OS_CHROMEOS)
84 // Returns true if this device is managed by an enterprise (as opposed to 86 // Returns true if this device is managed by an enterprise (as opposed to
85 // a local owner). 87 // a local owner).
86 bool IsEnterpriseManaged(); 88 bool IsEnterpriseManaged();
87 89
88 // Returns the enterprise domain if device is managed. 90 // Returns the enterprise domain if device is managed.
89 std::string GetEnterpriseDomain(); 91 std::string GetEnterpriseDomain();
90 92
91 // Returns the device mode. For ChromeOS this function will return the mode 93 // Returns the device mode. For ChromeOS this function will return the mode
92 // stored in the lockbox, or DEVICE_MODE_CONSUMER if the lockbox has been 94 // stored in the lockbox, or DEVICE_MODE_CONSUMER if the lockbox has been
93 // locked empty, or DEVICE_MODE_UNKNOWN if the device has not been owned yet. 95 // locked empty, or DEVICE_MODE_UNKNOWN if the device has not been owned yet.
94 // For other OSes the function will always return DEVICE_MODE_CONSUMER. 96 // For other OSes the function will always return DEVICE_MODE_CONSUMER.
95 DeviceMode GetDeviceMode(); 97 DeviceMode GetDeviceMode();
96 #endif 98 #endif
97 99
98 // Schedules initialization of the cloud policy backend services, if the 100 // Schedules initialization of the cloud policy backend services, if the
99 // services are already constructed. 101 // services are already constructed.
100 void ScheduleServiceInitialization(int64 delay_milliseconds); 102 void ScheduleServiceInitialization(int64 delay_milliseconds);
101 103
102 // Creates a new PolicyService that gets its policies from the global policy
103 // providers owned by the BrowserPolicyConnector and the optional
104 // |additional_providers|, which will have lower priority.
105 // The lifetime of the returned PolicyService is tied to the lifetime of
106 // the BrowserPolicyConnector.
107 scoped_ptr<PolicyService> CreatePolicyService(
108 const std::vector<ConfigurationPolicyProvider*>& additional_providers);
109
110 const ConfigurationPolicyHandlerList* GetHandlerList() const; 104 const ConfigurationPolicyHandlerList* GetHandlerList() const;
111 105
112 // Works out the user affiliation by checking the given |user_name| against 106 // Works out the user affiliation by checking the given |user_name| against
113 // the installation attributes. 107 // the installation attributes.
114 UserAffiliation GetUserAffiliation(const std::string& user_name); 108 UserAffiliation GetUserAffiliation(const std::string& user_name);
115 109
116 DeviceManagementService* device_management_service() { 110 DeviceManagementService* device_management_service() {
117 return device_management_service_.get(); 111 return device_management_service_.get();
118 } 112 }
119 113
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 scoped_ptr<AppPackUpdater> app_pack_updater_; 214 scoped_ptr<AppPackUpdater> app_pack_updater_;
221 scoped_ptr<NetworkConfigurationUpdater> network_configuration_updater_; 215 scoped_ptr<NetworkConfigurationUpdater> network_configuration_updater_;
222 #endif 216 #endif
223 217
224 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); 218 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector);
225 }; 219 };
226 220
227 } // namespace policy 221 } // namespace policy
228 222
229 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ 223 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698