| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_MANAGED_MODE_MANAGED_USER_REGISTRATION_UTILITY_H_ | 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_UTILITY_H_ |
| 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_UTILITY_H_ | 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_UTILITY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 virtual ~ManagedUserRegistrationUtility() {} | 54 virtual ~ManagedUserRegistrationUtility() {} |
| 55 | 55 |
| 56 // Creates ManagedUserRegistrationUtility for a given |profile|. | 56 // Creates ManagedUserRegistrationUtility for a given |profile|. |
| 57 static scoped_ptr<ManagedUserRegistrationUtility> Create(Profile* profile); | 57 static scoped_ptr<ManagedUserRegistrationUtility> Create(Profile* profile); |
| 58 | 58 |
| 59 static std::string GenerateNewManagedUserId(); | 59 static std::string GenerateNewManagedUserId(); |
| 60 | 60 |
| 61 // Registers a new managed user with the server. |managed_user_id| is a new | 61 // Registers a new managed user with the server. |managed_user_id| is a new |
| 62 // unique ID for the new managed user. If its value is the same as that of | 62 // unique ID for the new managed user. If its value is the same as that of |
| 63 // of one of the existing managed users, then the same user will be created | 63 // of one of the existing managed users, then the same user will be created |
| 64 // on this machine. |info| contains necessary information like the display | 64 // on this machine (and if he has no avatar in sync, his avatar will |
| 65 // name of the the user. |callback| is called with the result of the | 65 // be updated). |info| contains necessary information like |
| 66 // registration. We use the info here and not the profile, because on | 66 // the display name of the user and his avatar. |callback| is called |
| 67 // Chrome OS the profile of the managed user does not yet exist. | 67 // with the result of the registration. We use the info here and not the |
| 68 // profile, because on Chrome OS the profile of the managed user does not |
| 69 // yet exist. |
| 68 virtual void Register(const std::string& managed_user_id, | 70 virtual void Register(const std::string& managed_user_id, |
| 69 const ManagedUserRegistrationInfo& info, | 71 const ManagedUserRegistrationInfo& info, |
| 70 const RegistrationCallback& callback) = 0; | 72 const RegistrationCallback& callback) = 0; |
| 71 | 73 |
| 72 protected: | 74 protected: |
| 73 ManagedUserRegistrationUtility() {} | 75 ManagedUserRegistrationUtility() {} |
| 74 | 76 |
| 75 private: | 77 private: |
| 76 friend class ScopedTestingManagedUserRegistrationUtility; | 78 friend class ScopedTestingManagedUserRegistrationUtility; |
| 77 friend class ManagedUserRegistrationUtilityTest; | 79 friend class ManagedUserRegistrationUtilityTest; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 93 class ScopedTestingManagedUserRegistrationUtility { | 95 class ScopedTestingManagedUserRegistrationUtility { |
| 94 public: | 96 public: |
| 95 // Delegates ownership of the |instance| to ManagedUserRegistrationUtility. | 97 // Delegates ownership of the |instance| to ManagedUserRegistrationUtility. |
| 96 ScopedTestingManagedUserRegistrationUtility( | 98 ScopedTestingManagedUserRegistrationUtility( |
| 97 ManagedUserRegistrationUtility* instance); | 99 ManagedUserRegistrationUtility* instance); |
| 98 | 100 |
| 99 ~ScopedTestingManagedUserRegistrationUtility(); | 101 ~ScopedTestingManagedUserRegistrationUtility(); |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_UTILITY_H_ | 104 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_UTILITY_H_ |
| OLD | NEW |