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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_SERVICE_H_ |
6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_SERVICE_H_ | 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // the user. |callback| is called with the result of the registration. | 35 // the user. |callback| is called with the result of the registration. |
36 void Register(const string16& name, | 36 void Register(const string16& name, |
37 const RegistrationCallback& callback); | 37 const RegistrationCallback& callback); |
38 | 38 |
39 // Convenience method that registers a new managed user with the server and | 39 // Convenience method that registers a new managed user with the server and |
40 // initializes it locally. The callback allows it to be run after a new | 40 // initializes it locally. The callback allows it to be run after a new |
41 // profile has been created: | 41 // profile has been created: |
42 // ProfileManager::CreateMultiProfileAsync( | 42 // ProfileManager::CreateMultiProfileAsync( |
43 // name, icon, | 43 // name, icon, |
44 // managed_user_registration_service->GetRegistrationAndInitCallback(), | 44 // managed_user_registration_service->GetRegistrationAndInitCallback(), |
45 // desktop_type, managed_user); | 45 // managed_user); |
46 ProfileManager::CreateCallback GetRegistrationAndInitCallback(); | 46 ProfileManager::CreateCallback GetRegistrationAndInitCallback(); |
47 | 47 |
48 private: | 48 private: |
49 void DispatchCallback(); | 49 void DispatchCallback(); |
50 | 50 |
51 void OnProfileCreated(Profile* profile, | 51 void OnProfileCreated(Profile* profile, |
52 Profile::CreateStatus status); | 52 Profile::CreateStatus status); |
53 | 53 |
54 base::WeakPtrFactory<ManagedUserRegistrationService> weak_ptr_factory_; | 54 base::WeakPtrFactory<ManagedUserRegistrationService> weak_ptr_factory_; |
55 | 55 |
56 string16 display_name_; | 56 string16 display_name_; |
57 RegistrationCallback callback_; | 57 RegistrationCallback callback_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(ManagedUserRegistrationService); | 59 DISALLOW_COPY_AND_ASSIGN(ManagedUserRegistrationService); |
60 }; | 60 }; |
61 | 61 |
62 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_SERVICE_H_ | 62 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_SERVICE_H_ |
OLD | NEW |