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

Unified Diff: components/arc/user_data/arc_user_data_service.h

Issue 2165643004: arc: add enterprise_reporting.mojom interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved ArcUserDataService to make calls to ArcAuthService Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/arc/user_data/arc_user_data_service.h
diff --git a/components/arc/user_data/arc_user_data_service.h b/components/arc/user_data/arc_user_data_service.h
deleted file mode 100644
index 6c005029f76b85b2ac842225478781081bd39c9a..0000000000000000000000000000000000000000
--- a/components/arc/user_data/arc_user_data_service.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_ARC_USER_DATA_ARC_USER_DATA_SERVICE_H_
-#define COMPONENTS_ARC_USER_DATA_ARC_USER_DATA_SERVICE_H_
-
-#include <memory>
-
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "base/threading/thread_checker.h"
-#include "components/arc/arc_bridge_service.h"
-#include "components/arc/arc_service.h"
-#include "components/prefs/pref_change_registrar.h"
-#include "components/prefs/pref_member.h"
-#include "components/signin/core/account_id/account_id.h"
-
-namespace arc {
-
-class ArcBridgeService;
-
-// This class controls the lifecycle of ARC user data, removing it when
-// necessary.
-class ArcUserDataService : public ArcService,
- public ArcBridgeService::Observer {
- public:
- explicit ArcUserDataService(
- ArcBridgeService* arc_bridge_service,
- std::unique_ptr<BooleanPrefMember> arc_enabled_pref,
- const AccountId& account_id);
- ~ArcUserDataService() override;
-
- // ArcBridgeService::Observer:
- // Called whenever the arc bridge is stopped to potentially remove data if
- // the user has not opted in.
- void OnBridgeStopped(ArcBridgeService::StopReason reason) override;
-
- private:
- base::ThreadChecker thread_checker_;
-
- // Checks if ARC is both stopped and disabled (not opt-in) and triggers
- // removal of user data if both conditions are true.
- void ClearIfDisabled();
-
- // Callback when the kArcEnabled preference changes. It watches for instances
- // where the preference is disabled and remembers this so that it can wipe
- // user data once the bridge has stopped.
- void OnOptInPreferenceChanged();
-
- const std::unique_ptr<BooleanPrefMember> arc_enabled_pref_;
-
- // Account ID for the account for which we currently have opt-in information.
- AccountId primary_user_account_id_;
-
- // Registrar used to monitor ARC enabled state.
- PrefChangeRegistrar pref_change_registrar_;
-
- // Set to true when kArcEnabled goes from true to false and set to false
- // again after user data has been wiped. This ensures data is wiped even if
- // the user tries to enable ARC before the bridge has shut down.
- bool arc_disabled_ = false;
-
- base::WeakPtrFactory<ArcUserDataService> weak_ptr_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(ArcUserDataService);
-};
-
-} // namespace arc
-
-#endif // COMPONENTS_ARC_USER_DATA_ARC_USER_DATA_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698