| 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 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Translates the DeviceRegisterResponse::DeviceMode |mode| to the enum used | 26 // Translates the DeviceRegisterResponse::DeviceMode |mode| to the enum used |
| 27 // internally to represent different device modes. | 27 // internally to represent different device modes. |
| 28 DeviceMode TranslateProtobufDeviceMode( | 28 DeviceMode TranslateProtobufDeviceMode( |
| 29 em::DeviceRegisterResponse::DeviceMode mode) { | 29 em::DeviceRegisterResponse::DeviceMode mode) { |
| 30 switch (mode) { | 30 switch (mode) { |
| 31 case em::DeviceRegisterResponse::ENTERPRISE: | 31 case em::DeviceRegisterResponse::ENTERPRISE: |
| 32 return DEVICE_MODE_ENTERPRISE; | 32 return DEVICE_MODE_ENTERPRISE; |
| 33 case em::DeviceRegisterResponse::RETAIL: | 33 case em::DeviceRegisterResponse::RETAIL: |
| 34 return DEVICE_MODE_LEGACY_RETAIL_MODE; | 34 return DEVICE_MODE_LEGACY_RETAIL_MODE; |
| 35 case em::DeviceRegisterResponse::CHROME_AD: |
| 36 return DEVICE_MODE_ENTERPRISE_AD; |
| 35 } | 37 } |
| 36 LOG(ERROR) << "Unknown enrollment mode in registration response: " << mode; | 38 LOG(ERROR) << "Unknown enrollment mode in registration response: " << mode; |
| 37 return DEVICE_MODE_NOT_SET; | 39 return DEVICE_MODE_NOT_SET; |
| 38 } | 40 } |
| 39 | 41 |
| 40 bool IsChromePolicy(const std::string& type) { | 42 bool IsChromePolicy(const std::string& type) { |
| 41 return type == dm_protocol::kChromeDevicePolicyType || | 43 return type == dm_protocol::kChromeDevicePolicyType || |
| 42 type == dm_protocol::kChromeUserPolicyType; | 44 type == dm_protocol::kChromeUserPolicyType; |
| 43 } | 45 } |
| 44 | 46 |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 | 778 |
| 777 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { | 779 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { |
| 778 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); | 780 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); |
| 779 } | 781 } |
| 780 | 782 |
| 781 void CloudPolicyClient::NotifyClientError() { | 783 void CloudPolicyClient::NotifyClientError() { |
| 782 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); | 784 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); |
| 783 } | 785 } |
| 784 | 786 |
| 785 } // namespace policy | 787 } // namespace policy |
| OLD | NEW |