| 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 AccountId; |
| 12 class PrefRegistrySimple; | 13 class PrefRegistrySimple; |
| 13 | 14 |
| 14 namespace chromeos { | 15 namespace chromeos { |
| 15 | 16 |
| 16 // BootstrapManager manages bootstrap user specific values such as tracking | 17 // BootstrapManager manages bootstrap user specific values such as tracking |
| 17 // pending bootstrap and clearing such state. | 18 // pending bootstrap and clearing such state. |
| 18 class BootstrapManager { | 19 class BootstrapManager { |
| 19 public: | 20 public: |
| 20 static void RegisterPrefs(PrefRegistrySimple* registry); | 21 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 21 | 22 |
| 22 class Delegate { | 23 class Delegate { |
| 23 public: | 24 public: |
| 24 virtual void RemovePendingBootstrapUser(const std::string& user_id) = 0; | 25 virtual void RemovePendingBootstrapUser(const AccountId& account_id) = 0; |
| 25 | 26 |
| 26 protected: | 27 protected: |
| 27 virtual ~Delegate() {} | 28 virtual ~Delegate() {} |
| 28 }; | 29 }; |
| 29 | 30 |
| 30 explicit BootstrapManager(Delegate* delegate); | 31 explicit BootstrapManager(Delegate* delegate); |
| 31 ~BootstrapManager(); | 32 ~BootstrapManager(); |
| 32 | 33 |
| 33 void AddPendingBootstrap(const std::string& user_id); | 34 void AddPendingBootstrap(const AccountId& account_id); |
| 34 void FinishPendingBootstrap(const std::string& user_id); | 35 void FinishPendingBootstrap(const AccountId& account_id); |
| 35 void RemoveAllPendingBootstrap(); | 36 void RemoveAllPendingBootstrap(); |
| 36 | 37 |
| 37 bool HasPendingBootstrap(const std::string& user_id) const; | 38 bool HasPendingBootstrap(const AccountId& account_id) const; |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 Delegate* delegate_; | 41 Delegate* delegate_; |
| 41 | 42 |
| 42 DISALLOW_COPY_AND_ASSIGN(BootstrapManager); | 43 DISALLOW_COPY_AND_ASSIGN(BootstrapManager); |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 } // namespace chromeos | 46 } // namespace chromeos |
| 46 | 47 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_BOOTSTRAP_MANAGER_H_ | 48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_BOOTSTRAP_MANAGER_H_ |
| OLD | NEW |