| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_USERS_SCOPED_USER_MANAGER_ENABLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SCOPED_USER_MANAGER_ENABLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SCOPED_USER_MANAGER_ENABLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SCOPED_USER_MANAGER_ENABLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 | 9 |
| 10 namespace user_manager { | 10 namespace user_manager { |
| 11 class UserManager; | 11 class UserManager; |
| 12 } | 12 } |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 | 15 |
| 16 class ChromeUserManager; |
| 17 |
| 16 // Helper class for unit tests. Initializes the UserManager singleton to the | 18 // Helper class for unit tests. Initializes the UserManager singleton to the |
| 17 // given |user_manager| and tears it down again on destruction. If the singleton | 19 // given |user_manager| and tears it down again on destruction. If the singleton |
| 18 // had already been initialized, its previous value is restored after tearing | 20 // had already been initialized, its previous value is restored after tearing |
| 19 // down |user_manager|. | 21 // down |user_manager|. |
| 20 class ScopedUserManagerEnabler { | 22 class ScopedUserManagerEnabler { |
| 21 public: | 23 public: |
| 22 // Takes ownership of |user_manager|. | 24 // Takes ownership of |user_manager|. |
| 23 explicit ScopedUserManagerEnabler(user_manager::UserManager* user_manager); | 25 explicit ScopedUserManagerEnabler(ChromeUserManager* user_manager); |
| 24 ~ScopedUserManagerEnabler(); | 26 ~ScopedUserManagerEnabler(); |
| 25 | 27 |
| 26 private: | 28 private: |
| 27 user_manager::UserManager* previous_user_manager_; | 29 user_manager::UserManager* previous_user_manager_; |
| 28 | 30 |
| 29 DISALLOW_COPY_AND_ASSIGN(ScopedUserManagerEnabler); | 31 DISALLOW_COPY_AND_ASSIGN(ScopedUserManagerEnabler); |
| 30 }; | 32 }; |
| 31 | 33 |
| 32 } // namespace chromeos | 34 } // namespace chromeos |
| 33 | 35 |
| 34 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SCOPED_USER_MANAGER_ENABLER_H_ | 36 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SCOPED_USER_MANAGER_ENABLER_H_ |
| OLD | NEW |