| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/chromeos/arc/enterprise/arc_enterprise_reporting_servic
e.h" | 5 #include "chrome/browser/chromeos/arc/enterprise/arc_enterprise_reporting_servic
e.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "chrome/browser/chromeos/arc/arc_auth_service.h" | 11 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 12 #include "components/arc/arc_bridge_service.h" | 12 #include "components/arc/arc_bridge_service.h" |
| 13 #include "components/arc/arc_service_manager.h" | 13 #include "components/arc/arc_service_manager.h" |
| 14 #include "components/arc/user_data/arc_user_data_service.h" | 14 #include "components/arc/user_data/arc_user_data_service.h" |
| 15 | 15 |
| 16 namespace arc { | 16 namespace arc { |
| 17 | 17 |
| 18 ArcEnterpriseReportingService::ArcEnterpriseReportingService( | 18 ArcEnterpriseReportingService::ArcEnterpriseReportingService( |
| 19 ArcBridgeService* bridge_service) | 19 ArcBridgeService* bridge_service) |
| 20 : ArcService(bridge_service), binding_(this), weak_ptr_factory_(this) { | 20 : ArcService(bridge_service), binding_(this), weak_ptr_factory_(this) { |
| 21 arc_bridge_service()->enterprise_reporting()->AddObserver(this); | 21 arc_bridge_service()->enterprise_reporting()->AddObserver(this); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 35 instance->Init(binding_.CreateInterfacePtrAndBind()); | 35 instance->Init(binding_.CreateInterfacePtrAndBind()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void ArcEnterpriseReportingService::ReportManagementState( | 38 void ArcEnterpriseReportingService::ReportManagementState( |
| 39 mojom::ManagementState state) { | 39 mojom::ManagementState state) { |
| 40 DCHECK(thread_checker_.CalledOnValidThread()); | 40 DCHECK(thread_checker_.CalledOnValidThread()); |
| 41 VLOG(1) << "ReportManagementState state=" << state; | 41 VLOG(1) << "ReportManagementState state=" << state; |
| 42 | 42 |
| 43 if (state == mojom::ManagementState::MANAGED_DO_LOST) { | 43 if (state == mojom::ManagementState::MANAGED_DO_LOST) { |
| 44 DCHECK(ArcServiceManager::Get()); | 44 DCHECK(ArcServiceManager::Get()); |
| 45 ArcAuthService::Get()->RemoveArcData(); | 45 ArcSessionManager::Get()->RemoveArcData(); |
| 46 ArcAuthService::Get()->StopAndEnableArc(); | 46 ArcSessionManager::Get()->StopAndEnableArc(); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace arc | 50 } // namespace arc |
| OLD | NEW |