| OLD | NEW |
| 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 COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_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/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 17 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 18 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 18 #include "components/policy/policy_export.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 #include "policy/proto/device_management_backend.pb.h" | 21 #include "policy/proto/device_management_backend.pb.h" |
| 21 | 22 |
| 22 namespace net { | 23 namespace net { |
| 23 class URLRequestContextGetter; | 24 class URLRequestContextGetter; |
| 24 } | 25 } |
| 25 | 26 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 126 |
| 126 // The ID of URLFetchers created by the DeviceManagementService. This can be | 127 // The ID of URLFetchers created by the DeviceManagementService. This can be |
| 127 // used by tests that use a TestURLFetcherFactory to get the pending fetchers | 128 // used by tests that use a TestURLFetcherFactory to get the pending fetchers |
| 128 // created by the DeviceManagementService. | 129 // created by the DeviceManagementService. |
| 129 static const int kURLFetcherID; | 130 static const int kURLFetcherID; |
| 130 | 131 |
| 131 // Creates a new device management request job. Ownership is transferred to | 132 // Creates a new device management request job. Ownership is transferred to |
| 132 // the caller. | 133 // the caller. |
| 133 virtual DeviceManagementRequestJob* CreateJob( | 134 virtual DeviceManagementRequestJob* CreateJob( |
| 134 DeviceManagementRequestJob::JobType type, | 135 DeviceManagementRequestJob::JobType type, |
| 135 net::URLRequestContextGetter* request_context); | 136 const scoped_refptr<net::URLRequestContextGetter>& request_context); |
| 136 | 137 |
| 137 // Schedules a task to run |Initialize| after |delay_milliseconds| had passed. | 138 // Schedules a task to run |Initialize| after |delay_milliseconds| had passed. |
| 138 void ScheduleInitialization(int64 delay_milliseconds); | 139 void ScheduleInitialization(int64 delay_milliseconds); |
| 139 | 140 |
| 140 // Makes the service stop all requests. | 141 // Makes the service stop all requests. |
| 141 void Shutdown(); | 142 void Shutdown(); |
| 142 | 143 |
| 143 // Gets the URL that the DMServer requests are sent to. | 144 // Gets the URL that the DMServer requests are sent to. |
| 144 std::string GetServerUrl(); | 145 std::string GetServerUrl(); |
| 145 | 146 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 184 |
| 184 // Used to create tasks to run |Initialize| delayed on the UI thread. | 185 // Used to create tasks to run |Initialize| delayed on the UI thread. |
| 185 base::WeakPtrFactory<DeviceManagementService> weak_ptr_factory_; | 186 base::WeakPtrFactory<DeviceManagementService> weak_ptr_factory_; |
| 186 | 187 |
| 187 DISALLOW_COPY_AND_ASSIGN(DeviceManagementService); | 188 DISALLOW_COPY_AND_ASSIGN(DeviceManagementService); |
| 188 }; | 189 }; |
| 189 | 190 |
| 190 } // namespace policy | 191 } // namespace policy |
| 191 | 192 |
| 192 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_ | 193 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_DEVICE_MANAGEMENT_SERVICE_H_ |
| OLD | NEW |