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

Side by Side Diff: chrome/browser/chromeos/arc/arc_enterprise_reporting_service.cc

Issue 2248353002: [M53 cherry-pick] Migrate ArcUserDataService into ArcAuthService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 months 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
OLDNEW
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/arc_enterprise_reporting_service.h" 5 #include "chrome/browser/chromeos/arc/arc_enterprise_reporting_service.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"
(...skipping 20 matching lines...) Expand all
31 binding_.CreateInterfacePtrAndBind()); 31 binding_.CreateInterfacePtrAndBind());
32 } 32 }
33 33
34 void ArcEnterpriseReportingService::ReportManagementState( 34 void ArcEnterpriseReportingService::ReportManagementState(
35 mojom::ManagementState state) { 35 mojom::ManagementState state) {
36 DCHECK(thread_checker_.CalledOnValidThread()); 36 DCHECK(thread_checker_.CalledOnValidThread());
37 VLOG(1) << "ReportManagementState state=" << state; 37 VLOG(1) << "ReportManagementState state=" << state;
38 38
39 if (state == mojom::ManagementState::MANAGED_DO_LOST) { 39 if (state == mojom::ManagementState::MANAGED_DO_LOST) {
40 DCHECK(arc::ArcServiceManager::Get()); 40 DCHECK(arc::ArcServiceManager::Get());
41 ArcServiceManager::Get()->arc_user_data_service()->RequireUserDataWiped( 41 ArcAuthService::Get()->RemoveArcData();
42 base::Bind(&ArcEnterpriseReportingService::RestartArc, 42 ArcAuthService::Get()->StopAndEnableArc();
43 weak_ptr_factory_.GetWeakPtr()));
44 ArcAuthService::Get()->StopArc();
45 } 43 }
46 } 44 }
47 45
48 void ArcEnterpriseReportingService::RestartArc(bool result) {
49 DCHECK(thread_checker_.CalledOnValidThread());
50 if (!result)
51 LOG(ERROR) << "Required ARC user data wipe failed.";
52
53 // Restart ARC anyway. Let the enterprise reporting instance decide whether
54 // the ARC user data wipe is still required or not.
55 VLOG(1) << "Restart ARC";
56 ArcAuthService::Get()->EnableArc();
57 }
58
59 } // namespace arc 46 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_enterprise_reporting_service.h ('k') | chrome/browser/ui/app_list/arc/arc_app_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698