OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_CHROMEOS_ARC_ARC_ENTERPRISE_REPORTING_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_ENTERPRISE_REPORTING_SERVICE_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/threading/thread_checker.h" |
| 13 #include "components/arc/arc_bridge_service.h" |
| 14 #include "components/arc/arc_service.h" |
| 15 #include "components/arc/instance_holder.h" |
| 16 #include "mojo/public/cpp/bindings/binding.h" |
| 17 |
| 18 namespace arc { |
| 19 |
| 20 // This class controls the ARC enterprise reporting. |
| 21 class ArcEnterpriseReportingService |
| 22 : public ArcService, |
| 23 public InstanceHolder<mojom::EnterpriseReportingInstance>::Observer, |
| 24 public mojom::EnterpriseReportingHost { |
| 25 public: |
| 26 explicit ArcEnterpriseReportingService(ArcBridgeService* arc_bridge_service); |
| 27 ~ArcEnterpriseReportingService() override; |
| 28 |
| 29 // InstanceHolder<mojom::EnterpriseReportingInstance>::Observer overrides: |
| 30 void OnInstanceReady() override; |
| 31 |
| 32 // mojom::EnterpriseReportingHost overrides: |
| 33 void ReportManagementState(mojom::ManagementState state) override; |
| 34 |
| 35 private: |
| 36 // DBus callback, restarts ARC after ARC user data wipe. |
| 37 void RestartArc(bool success); |
| 38 |
| 39 base::ThreadChecker thread_checker_; |
| 40 |
| 41 mojo::Binding<mojom::EnterpriseReportingHost> binding_; |
| 42 |
| 43 base::WeakPtrFactory<ArcEnterpriseReportingService> weak_ptr_factory_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(ArcEnterpriseReportingService); |
| 46 }; |
| 47 |
| 48 } // namespace arc |
| 49 |
| 50 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_ENTERPRISE_REPORTING_SERVICE_H_ |
OLD | NEW |