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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..add58a5d2894052910012fabf66e1d034d0b044b |
--- /dev/null |
+++ b/components/arc/user_data/arc_user_data_service.h |
@@ -0,0 +1,46 @@ |
+// 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 |
+#define COMPONENTS_ARC_USER_DATA_ARC_USER_DATA_SERVICE |
+ |
+#include "base/macros.h" |
+#include "base/threading/thread_checker.h" |
+#include "components/arc/arc_bridge_service.h" |
+#include "components/signin/core/account_id/account_id.h" |
+ |
+class PrefService; |
+ |
+namespace arc { |
+ |
+class ArcServiceManager; |
+class ArcBridgeService; |
+ |
+// This class controls the lifecycle of ARC user data, removing it when |
+// necessary. |
+class ArcUserDataService : public ArcBridgeService::Observer { |
+ public: |
+ ArcUserDataService(ArcServiceManager* arc_service_manager); |
Luis Héctor Chávez
2016/05/20 15:03:59
|arc_service_manager| can be made const.
Daniel Erat
2016/05/20 17:41:06
add 'explicit' too
dspaid
2016/05/23 01:22:37
Done.
dspaid
2016/05/23 01:22:37
Done.
|
+ ~ArcUserDataService() override; |
+ |
+ // Checks if arc is both stopped and disabled (opt-out) and triggers removal |
Luis Héctor Chávez
2016/05/20 15:03:59
nit: s/opt-out/not opt-in/.
Daniel Erat
2016/05/20 17:41:06
s/arc/ARC/ here and in other comments
dspaid
2016/05/23 01:22:37
Done.
dspaid
2016/05/23 01:22:37
Done.
|
+ // of user data if both conditions are true. |
+ void ClearIfDisabled(const AccountId& account_id); |
+ |
+ // Called whenever the arc bridge is stopped to potentially remove data if |
+ // the user has opted out. |
Luis Héctor Chávez
2016/05/20 15:03:59
nit: s/opted out/not opted-in/.
dspaid
2016/05/23 01:22:37
Done.
|
+ // ArcBridgeService::Observer: |
Daniel Erat
2016/05/20 17:41:06
nit: move this comment above "Called whenever" (bu
dspaid
2016/05/23 01:22:37
Done.
|
+ void OnBridgeStopped() override; |
+ |
+ private: |
+ base::ThreadChecker thread_checker_; |
+ |
+ AccountId user_prefs_account_id_ = EmptyAccountId(); |
Daniel Erat
2016/05/20 17:41:06
add a comment documenting what this contains; also
dspaid
2016/05/23 01:22:37
Done.
|
+ ArcServiceManager* arc_service_manager_; |
Luis Héctor Chávez
2016/05/20 15:03:58
nit: const ArcServiceManager* const arc_service_ma
dspaid
2016/05/23 01:22:37
Done.
|
+ DISALLOW_COPY_AND_ASSIGN(ArcUserDataService); |
Daniel Erat
2016/05/20 17:41:06
nit: add blank line before this one
dspaid
2016/05/23 01:22:37
Done.
|
+}; |
+ |
+} // namespace arc |
+ |
+#endif // COMPONENTS_ARC_USER_DATA_ARC_USER_DATA_SERVICE |