OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_BOOTSTRAP_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_BOOTSTRAP_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_BOOTSTRAP_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_BOOTSTRAP_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 | 11 |
12 class PrefRegistrySimple; | 12 class PrefRegistrySimple; |
13 | 13 |
| 14 namespace user_manager { |
| 15 class UserID; |
| 16 } |
| 17 |
14 namespace chromeos { | 18 namespace chromeos { |
15 | 19 |
16 // BootstrapManager manages bootstrap user specific values such as tracking | 20 // BootstrapManager manages bootstrap user specific values such as tracking |
17 // pending bootstrap and clearing such state. | 21 // pending bootstrap and clearing such state. |
18 class BootstrapManager { | 22 class BootstrapManager { |
19 public: | 23 public: |
20 static void RegisterPrefs(PrefRegistrySimple* registry); | 24 static void RegisterPrefs(PrefRegistrySimple* registry); |
21 | 25 |
22 class Delegate { | 26 class Delegate { |
23 public: | 27 public: |
24 virtual void RemovePendingBootstrapUser(const std::string& user_id) = 0; | 28 virtual void RemovePendingBootstrapUser(const user_manager::UserID& user_id)
= 0; |
25 | 29 |
26 protected: | 30 protected: |
27 virtual ~Delegate() {} | 31 virtual ~Delegate() {} |
28 }; | 32 }; |
29 | 33 |
30 explicit BootstrapManager(Delegate* delegate); | 34 explicit BootstrapManager(Delegate* delegate); |
31 ~BootstrapManager(); | 35 ~BootstrapManager(); |
32 | 36 |
33 void AddPendingBootstrap(const std::string& user_id); | 37 void AddPendingBootstrap(const user_manager::UserID& user_id); |
34 void FinishPendingBootstrap(const std::string& user_id); | 38 void FinishPendingBootstrap(const user_manager::UserID& user_id); |
35 void RemoveAllPendingBootstrap(); | 39 void RemoveAllPendingBootstrap(); |
36 | 40 |
37 bool HasPendingBootstrap(const std::string& user_id) const; | 41 bool HasPendingBootstrap(const user_manager::UserID& user_id) const; |
38 | 42 |
39 private: | 43 private: |
40 Delegate* delegate_; | 44 Delegate* delegate_; |
41 | 45 |
42 DISALLOW_COPY_AND_ASSIGN(BootstrapManager); | 46 DISALLOW_COPY_AND_ASSIGN(BootstrapManager); |
43 }; | 47 }; |
44 | 48 |
45 } // namespace chromeos | 49 } // namespace chromeos |
46 | 50 |
47 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_BOOTSTRAP_MANAGER_H_ | 51 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_BOOTSTRAP_MANAGER_H_ |
OLD | NEW |