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. |update_avatar| can only be true when a managed user |
65 // name of the the user. |callback| is called with the result of the | 65 // is being imported, in this case the managed user's avatar will also |
66 // registration. We use the info here and not the profile, because on | 66 // be updated on the sync server. |info| contains necessary information like |
67 // Chrome OS the profile of the managed user does not yet exist. | 67 // the display name of the user and his avatar. |callback| is called |
| 68 // with the result of the registration. We use the info here and not the |
| 69 // profile, because on Chrome OS the profile of the managed user does not |
| 70 // yet exist. |
68 virtual void Register(const std::string& managed_user_id, | 71 virtual void Register(const std::string& managed_user_id, |
| 72 bool update_avatar, |
69 const ManagedUserRegistrationInfo& info, | 73 const ManagedUserRegistrationInfo& info, |
70 const RegistrationCallback& callback) = 0; | 74 const RegistrationCallback& callback) = 0; |
71 | 75 |
72 protected: | 76 protected: |
73 ManagedUserRegistrationUtility() {} | 77 ManagedUserRegistrationUtility() {} |
74 | 78 |
75 private: | 79 private: |
76 friend class ScopedTestingManagedUserRegistrationUtility; | 80 friend class ScopedTestingManagedUserRegistrationUtility; |
77 friend class ManagedUserRegistrationUtilityTest; | 81 friend class ManagedUserRegistrationUtilityTest; |
78 | 82 |
(...skipping 14 matching lines...) Expand all Loading... |
93 class ScopedTestingManagedUserRegistrationUtility { | 97 class ScopedTestingManagedUserRegistrationUtility { |
94 public: | 98 public: |
95 // Delegates ownership of the |instance| to ManagedUserRegistrationUtility. | 99 // Delegates ownership of the |instance| to ManagedUserRegistrationUtility. |
96 ScopedTestingManagedUserRegistrationUtility( | 100 ScopedTestingManagedUserRegistrationUtility( |
97 ManagedUserRegistrationUtility* instance); | 101 ManagedUserRegistrationUtility* instance); |
98 | 102 |
99 ~ScopedTestingManagedUserRegistrationUtility(); | 103 ~ScopedTestingManagedUserRegistrationUtility(); |
100 }; | 104 }; |
101 | 105 |
102 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_UTILITY_H_ | 106 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_UTILITY_H_ |
OLD | NEW |