Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / chromeos / policy / consumer_unenrollment_handler.h
blob8f556620c897732d38e4041d83b8bbe44a466db1
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_UNENROLLMENT_HANDLER_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_UNENROLLMENT_HANDLER_H_
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "components/keyed_service/core/keyed_service.h"
12 namespace chromeos {
13 class DeviceSettingsService;
14 class OwnerSettingsServiceChromeOS;
17 namespace policy {
19 class ConsumerManagementService;
20 class DeviceCloudPolicyManagerChromeOS;
22 // ConsumerUnenrollmentHandler unenrolls the device from the consumer management
23 // service. It sends a request to the server and resets the management settings.
24 class ConsumerUnenrollmentHandler : public KeyedService {
25 public:
26 ConsumerUnenrollmentHandler(
27 chromeos::DeviceSettingsService* device_settings_service,
28 ConsumerManagementService* consumer_management_service,
29 DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager,
30 chromeos::OwnerSettingsServiceChromeOS* owner_settings_service);
31 ~ConsumerUnenrollmentHandler() override;
33 // Starts the unenrollment process.
34 void Start();
36 private:
37 void OnUnregistered(bool success);
38 void OnManagementSettingsSet(bool success);
40 chromeos::DeviceSettingsService* device_settings_service_;
41 ConsumerManagementService* consumer_management_service_;
42 DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager_;
43 chromeos::OwnerSettingsServiceChromeOS* owner_settings_service_;
45 base::WeakPtrFactory<ConsumerUnenrollmentHandler> weak_factory_;
47 DISALLOW_COPY_AND_ASSIGN(ConsumerUnenrollmentHandler);
50 } // namespace policy
52 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_UNENROLLMENT_HANDLER_H_