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

Unified Diff: chrome/browser/chromeos/arc/arc_data_manager.h

Issue 1966133002: Run RemoveArcData after a user has opted out (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: chrome/browser/chromeos/arc/arc_data_manager.h
diff --git a/chrome/browser/chromeos/arc/arc_data_manager.h b/chrome/browser/chromeos/arc/arc_data_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..d271af50139aa3dc2dffdf1da34d4efe27c51762
--- /dev/null
+++ b/chrome/browser/chromeos/arc/arc_data_manager.h
@@ -0,0 +1,44 @@
+// 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 CHROME_BROWSER_CHROMEOS_ARC_ARC_DATA_MANAGER_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_ARC_DATA_MANAGER_H_
+
+#include "base/macros.h"
+#include "base/threading/thread_checker.h"
+#include "components/arc/arc_bridge_service.h"
+
+class Profile;
+
+namespace arc {
+
+class ArcBridgeService;
+
+// This class controls the lifecycle of ARC user data, removing it when
+// necessary.
stevenjb 2016/05/13 17:13:55 May I suggest renaming this something like ArcUser
dspaid 2016/05/17 01:56:14 Done.
+class ArcDataManager : public ArcBridgeService::Observer {
+ public:
+ ArcDataManager();
+ ~ArcDataManager() override;
+
+ static ArcDataManager* Get();
+
+ // Checks if arc is both stopped and disabled (opt-out) and triggers removal
+ // of user data if both conditions are true.
+ void ClearIfDisabled(Profile* profile);
+
+ // Called whenever arc service state changes to potentially remove data if
+ // the user has opted out.
+ // ArcBridgeService::Observer:
+ void OnStateChanged(ArcBridgeService::State state) override;
+
+ private:
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcDataManager);
+};
+
+} // namespace arc
+
+#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_DATA_MANAGER_H_
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_data_manager.cc » ('j') | chrome/browser/chromeos/arc/arc_data_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698