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

Side by Side Diff: components/policy/core/common/cloud/device_management_service.h

Issue 109743002: Move policy code into components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar fixes Created 7 years 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_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_ 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_
6 #define CHROME_BROWSER_POLICY_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_ 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "chrome/browser/policy/cloud/cloud_policy_constants.h"
18 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" 17 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
18 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
19 #include "components/policy/policy_export.h"
19 #include "net/url_request/url_fetcher_delegate.h" 20 #include "net/url_request/url_fetcher_delegate.h"
20 21
21 namespace net { 22 namespace net {
22 class URLRequestContextGetter; 23 class URLRequestContextGetter;
23 } 24 }
24 25
25 namespace policy { 26 namespace policy {
26 27
27 class DeviceManagementRequestJobImpl; 28 class DeviceManagementRequestJobImpl;
28 class DeviceManagementService; 29 class DeviceManagementService;
29 30
30 // DeviceManagementRequestJob describes a request to send to the device 31 // DeviceManagementRequestJob describes a request to send to the device
31 // management service. Jobs are created by DeviceManagementService. They can be 32 // management service. Jobs are created by DeviceManagementService. They can be
32 // canceled by deleting the object. 33 // canceled by deleting the object.
33 class DeviceManagementRequestJob { 34 class POLICY_EXPORT DeviceManagementRequestJob {
34 public: 35 public:
35 // Describes the job type. 36 // Describes the job type.
36 enum JobType { 37 enum JobType {
37 TYPE_AUTO_ENROLLMENT, 38 TYPE_AUTO_ENROLLMENT,
38 TYPE_REGISTRATION, 39 TYPE_REGISTRATION,
39 TYPE_API_AUTH_CODE_FETCH, 40 TYPE_API_AUTH_CODE_FETCH,
40 TYPE_POLICY_FETCH, 41 TYPE_POLICY_FETCH,
41 TYPE_UNREGISTRATION, 42 TYPE_UNREGISTRATION,
42 TYPE_UPLOAD_CERTIFICATE, 43 TYPE_UPLOAD_CERTIFICATE,
43 }; 44 };
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 Callback callback_; 92 Callback callback_;
92 93
93 private: 94 private:
94 DISALLOW_COPY_AND_ASSIGN(DeviceManagementRequestJob); 95 DISALLOW_COPY_AND_ASSIGN(DeviceManagementRequestJob);
95 }; 96 };
96 97
97 // The device management service is responsible for everything related to 98 // The device management service is responsible for everything related to
98 // communication with the device management server. It creates the backends 99 // communication with the device management server. It creates the backends
99 // objects that the device management policy provider and friends use to issue 100 // objects that the device management policy provider and friends use to issue
100 // requests. 101 // requests.
101 class DeviceManagementService : public net::URLFetcherDelegate { 102 class POLICY_EXPORT DeviceManagementService : public net::URLFetcherDelegate {
102 public: 103 public:
103 // Obtains the parameters used to contact the server. 104 // Obtains the parameters used to contact the server.
104 // This allows creating the DeviceManagementService early and getting these 105 // This allows creating the DeviceManagementService early and getting these
105 // parameters later. Passing the parameters directly in the ctor isn't 106 // parameters later. Passing the parameters directly in the ctor isn't
106 // possible because some aren't ready during startup. http://crbug.com/302798 107 // possible because some aren't ready during startup. http://crbug.com/302798
107 class Configuration { 108 class POLICY_EXPORT Configuration {
108 public: 109 public:
109 virtual ~Configuration() {} 110 virtual ~Configuration() {}
110 111
111 // Server at which to contact the service. 112 // Server at which to contact the service.
112 virtual std::string GetServerUrl() = 0; 113 virtual std::string GetServerUrl() = 0;
113 114
114 // Agent reported in the "agent" query parameter. 115 // Agent reported in the "agent" query parameter.
115 virtual std::string GetAgentParameter() = 0; 116 virtual std::string GetAgentParameter() = 0;
116 117
117 // The platform reported in the "platform" query parameter. 118 // The platform reported in the "platform" query parameter.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 bool initialized_; 181 bool initialized_;
181 182
182 // Used to create tasks to run |Initialize| delayed on the UI thread. 183 // Used to create tasks to run |Initialize| delayed on the UI thread.
183 base::WeakPtrFactory<DeviceManagementService> weak_ptr_factory_; 184 base::WeakPtrFactory<DeviceManagementService> weak_ptr_factory_;
184 185
185 DISALLOW_COPY_AND_ASSIGN(DeviceManagementService); 186 DISALLOW_COPY_AND_ASSIGN(DeviceManagementService);
186 }; 187 };
187 188
188 } // namespace policy 189 } // namespace policy
189 190
190 #endif // CHROME_BROWSER_POLICY_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_ 191 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698