OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_ARC_USER_DATA_ARC_USER_DATA_SERVICE | |
6 #define COMPONENTS_ARC_USER_DATA_ARC_USER_DATA_SERVICE | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/threading/thread_checker.h" | |
10 #include "components/arc/arc_bridge_service.h" | |
11 #include "components/signin/core/account_id/account_id.h" | |
12 | |
13 class PrefService; | |
14 | |
15 namespace arc { | |
16 | |
17 class ArcServiceManager; | |
18 class ArcBridgeService; | |
19 | |
20 // This class controls the lifecycle of ARC user data, removing it when | |
21 // necessary. | |
22 class ArcUserDataService : public ArcBridgeService::Observer { | |
23 public: | |
24 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.
| |
25 ~ArcUserDataService() override; | |
26 | |
27 // 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.
| |
28 // of user data if both conditions are true. | |
29 void ClearIfDisabled(const AccountId& account_id); | |
30 | |
31 // Called whenever the arc bridge is stopped to potentially remove data if | |
32 // 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.
| |
33 // 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.
| |
34 void OnBridgeStopped() override; | |
35 | |
36 private: | |
37 base::ThreadChecker thread_checker_; | |
38 | |
39 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.
| |
40 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.
| |
41 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.
| |
42 }; | |
43 | |
44 } // namespace arc | |
45 | |
46 #endif // COMPONENTS_ARC_USER_DATA_ARC_USER_DATA_SERVICE | |
OLD | NEW |