 Chromium Code Reviews
 Chromium Code Reviews Issue 1966133002:
  Run RemoveArcData after a user has opted out  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1966133002:
  Run RemoveArcData after a user has opted out  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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..8a177d633459390945184519a6d7c53b7305a84b | 
| --- /dev/null | 
| +++ b/chrome/browser/chromeos/arc/arc_data_manager.h | 
| @@ -0,0 +1,43 @@ | 
| +// 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 | 
| 
Daniel Erat
2016/05/12 16:33:35
nit: s/arc/ARC/
 
dspaid
2016/05/13 01:19:25
Done.
 | 
| +// necessary. | 
| +class ArcDataManager : public ArcBridgeService::Observer { | 
| + public: | 
| + ArcDataManager(); | 
| + ~ArcDataManager(); | 
| 
Daniel Erat
2016/05/12 16:33:34
override
 
dspaid
2016/05/13 01:19:24
Done.
 | 
| + | 
| + static ArcDataManager* Get(); | 
| 
Daniel Erat
2016/05/12 16:33:35
if at all possible, please instead pass the instan
 
dspaid
2016/05/13 01:19:24
I'm open to suggestions here.  The current use is
 
stevenjb
2016/05/13 17:13:54
We should at least make this consistent with other
 
dspaid
2016/05/17 01:56:14
Done.
 | 
| + | 
| + // 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. | 
| + void OnStateChanged(ArcBridgeService::State state) override; | 
| 
Daniel Erat
2016/05/12 16:33:35
nit: add an:
  // ArcBridgeService::Observer:
co
 
dspaid
2016/05/13 01:19:25
Done.
 | 
| + | 
| + private: | 
| + base::ThreadChecker thread_checker_; | 
| + | 
| + DISALLOW_COPY_AND_ASSIGN(ArcDataManager); | 
| +}; | 
| + | 
| +} // namespace arc | 
| + | 
| +#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_DATA_MANAGER_H_ |