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

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

Issue 4121003: Implement device token fetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final feedback Created 10 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
« no previous file with comments | « chrome/browser/net/gaia/token_service.cc ('k') | chrome/browser/policy/device_token_fetcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_H_
6 #define CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "base/non_thread_safe.h"
13 #include "chrome/browser/policy/proto/device_management_backend.pb.h"
14
15 namespace policy {
16
17 namespace em = enterprise_management;
18
19 // Interface for clients that need to converse with the device management
20 // server, which provides services to register Chrome installations and CrOS
21 // devices for the purpose of fetching centrally-administered policy from the
22 // cloud.
23 class DeviceManagementBackend : NonThreadSafe {
24 public:
25 enum ErrorCode {
26 // Request payload invalid.
27 kErrorRequestInvalid,
28 // The HTTP request failed.
29 kErrorRequestFailed,
30 // The HTTP request returned a non-success code.
31 kErrorHttpStatus,
32 // Response could not be decoded.
33 kErrorResponseDecoding,
34 // Service error: Management not supported.
35 kErrorServiceManagementNotSupported,
36 // Service error: Device not found.
37 kErrorServiceDeviceNotFound,
38 // Service error: Device token invalid.
39 kErrorServiceManagementTokenInvalid,
40 // Service error: Activation pending.
41 kErrorServiceActivationPending,
42 };
43
44 class DeviceRegisterResponseDelegate {
45 public:
46 virtual ~DeviceRegisterResponseDelegate() {}
47 virtual void HandleRegisterResponse(
48 const em::DeviceRegisterResponse& response) = 0;
49 virtual void OnError(ErrorCode code) = 0;
50
51 protected:
52 DeviceRegisterResponseDelegate() {}
53
54 private:
55 DISALLOW_COPY_AND_ASSIGN(DeviceRegisterResponseDelegate);
56 };
57
58 class DeviceUnregisterResponseDelegate {
59 public:
60 virtual ~DeviceUnregisterResponseDelegate() {}
61 virtual void HandleUnregisterResponse(
62 const em::DeviceUnregisterResponse& response) = 0;
63 virtual void OnError(ErrorCode code) = 0;
64
65 protected:
66 DeviceUnregisterResponseDelegate() {}
67
68 private:
69 DISALLOW_COPY_AND_ASSIGN(DeviceUnregisterResponseDelegate);
70 };
71
72 class DevicePolicyResponseDelegate {
73 public:
74 virtual ~DevicePolicyResponseDelegate() {}
75
76 virtual void HandlePolicyResponse(
77 const em::DevicePolicyResponse& response) = 0;
78 virtual void OnError(ErrorCode code) = 0;
79
80 protected:
81 DevicePolicyResponseDelegate() {}
82
83 private:
84 DISALLOW_COPY_AND_ASSIGN(DevicePolicyResponseDelegate);
85 };
86
87 virtual ~DeviceManagementBackend() {}
88
89 virtual void ProcessRegisterRequest(
90 const std::string& auth_token,
91 const std::string& device_id,
92 const em::DeviceRegisterRequest& request,
93 DeviceRegisterResponseDelegate* delegate) = 0;
94
95 virtual void ProcessUnregisterRequest(
96 const std::string& device_management_token,
97 const em::DeviceUnregisterRequest& request,
98 DeviceUnregisterResponseDelegate* delegate) = 0;
99
100 virtual void ProcessPolicyRequest(
101 const std::string& device_management_token,
102 const em::DevicePolicyRequest& request,
103 DevicePolicyResponseDelegate* delegate) = 0;
104
105 protected:
106 DeviceManagementBackend() {}
107
108 private:
109 DISALLOW_COPY_AND_ASSIGN(DeviceManagementBackend);
110 };
111
112 } // namespace policy
113
114 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/gaia/token_service.cc ('k') | chrome/browser/policy/device_token_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698