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 CHROME_BROWSER_CHROMEOS_ARC_ARC_DATA_MANAGER_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_DATA_MANAGER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/threading/thread_checker.h" | |
10 #include "components/arc/arc_bridge_service.h" | |
11 | |
12 class Profile; | |
13 | |
14 namespace arc { | |
15 | |
16 class ArcBridgeService; | |
17 | |
18 // This class controls the lifecycle of ARC user data, removing it when | |
19 // necessary. | |
stevenjb
2016/05/13 17:13:55
May I suggest renaming this something like ArcUser
dspaid
2016/05/17 01:56:14
Done.
| |
20 class ArcDataManager : public ArcBridgeService::Observer { | |
21 public: | |
22 ArcDataManager(); | |
23 ~ArcDataManager() override; | |
24 | |
25 static ArcDataManager* Get(); | |
26 | |
27 // Checks if arc is both stopped and disabled (opt-out) and triggers removal | |
28 // of user data if both conditions are true. | |
29 void ClearIfDisabled(Profile* profile); | |
30 | |
31 // Called whenever arc service state changes to potentially remove data if | |
32 // the user has opted out. | |
33 // ArcBridgeService::Observer: | |
34 void OnStateChanged(ArcBridgeService::State state) override; | |
35 | |
36 private: | |
37 base::ThreadChecker thread_checker_; | |
38 | |
39 DISALLOW_COPY_AND_ASSIGN(ArcDataManager); | |
40 }; | |
41 | |
42 } // namespace arc | |
43 | |
44 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_DATA_MANAGER_H_ | |
OLD | NEW |