| 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_SUPERVISED_USER_CHROMEOS_MANAGER_PASSWORD_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_MANAGER_PASSWORD_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_MANAGER_PASSWORD_SERVICE_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_MANAGER_PASSWORD_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" | 14 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" |
| 15 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" | 15 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" |
| 16 #include "chrome/browser/supervised_user/supervised_users.h" | 16 #include "chrome/browser/supervised_user/supervised_users.h" |
| 17 #include "chromeos/login/auth/extended_authenticator.h" | 17 #include "chromeos/login/auth/extended_authenticator.h" |
| 18 #include "components/keyed_service/core/keyed_service.h" | 18 #include "components/keyed_service/core/keyed_service.h" |
| 19 | 19 |
| 20 namespace chromeos { | 20 namespace chromeos { |
| 21 | 21 |
| 22 class UserContext; | 22 class UserContext; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 SupervisedUserSharedSettingsService* service); | 43 SupervisedUserSharedSettingsService* service); |
| 44 | 44 |
| 45 // chromeos::ExtendedAuthenticator::AuthStatusConsumer overrides: | 45 // chromeos::ExtendedAuthenticator::AuthStatusConsumer overrides: |
| 46 void OnAuthenticationFailure(ExtendedAuthenticator::AuthState state) override; | 46 void OnAuthenticationFailure(ExtendedAuthenticator::AuthState state) override; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 void OnSharedSettingsChange(const std::string& su_id, const std::string& key); | 49 void OnSharedSettingsChange(const std::string& su_id, const std::string& key); |
| 50 void GetSupervisedUsersCallback( | 50 void GetSupervisedUsersCallback( |
| 51 const std::string& sync_su_id, | 51 const std::string& sync_su_id, |
| 52 const std::string& user_id, | 52 const std::string& user_id, |
| 53 scoped_ptr<base::DictionaryValue> password_data, | 53 std::unique_ptr<base::DictionaryValue> password_data, |
| 54 const base::DictionaryValue* supervised_users); | 54 const base::DictionaryValue* supervised_users); |
| 55 void OnAddKeySuccess(const UserContext& master_key_context, | 55 void OnAddKeySuccess(const UserContext& master_key_context, |
| 56 const std::string& user_id, | 56 const std::string& user_id, |
| 57 scoped_ptr<base::DictionaryValue> password_data); | 57 std::unique_ptr<base::DictionaryValue> password_data); |
| 58 void OnKeyTransformedIfNeeded(const UserContext& master_key_context); | 58 void OnKeyTransformedIfNeeded(const UserContext& master_key_context); |
| 59 void OnNewManagerKeySuccess(const UserContext& master_key_context); | 59 void OnNewManagerKeySuccess(const UserContext& master_key_context); |
| 60 void OnOldSupervisedUserKeyDeleted(const UserContext& master_key_context); | 60 void OnOldSupervisedUserKeyDeleted(const UserContext& master_key_context); |
| 61 void OnOldManagerKeyDeleted(const UserContext& master_key_context); | 61 void OnOldManagerKeyDeleted(const UserContext& master_key_context); |
| 62 | 62 |
| 63 // Cached value from Init(). | 63 // Cached value from Init(). |
| 64 // User id of currently logged in user, that have supervised users on device. | 64 // User id of currently logged in user, that have supervised users on device. |
| 65 std::string user_id_; | 65 std::string user_id_; |
| 66 SupervisedUserSyncService* user_service_; | 66 SupervisedUserSyncService* user_service_; |
| 67 SupervisedUserSharedSettingsService* settings_service_; | 67 SupervisedUserSharedSettingsService* settings_service_; |
| 68 | 68 |
| 69 scoped_ptr<SupervisedUserSharedSettingsService::ChangeCallbackList:: | 69 std::unique_ptr< |
| 70 Subscription> | 70 SupervisedUserSharedSettingsService::ChangeCallbackList::Subscription> |
| 71 settings_service_subscription_; | 71 settings_service_subscription_; |
| 72 | 72 |
| 73 scoped_refptr<ExtendedAuthenticator> authenticator_; | 73 scoped_refptr<ExtendedAuthenticator> authenticator_; |
| 74 | 74 |
| 75 base::WeakPtrFactory<ManagerPasswordService> weak_ptr_factory_; | 75 base::WeakPtrFactory<ManagerPasswordService> weak_ptr_factory_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(ManagerPasswordService); | 77 DISALLOW_COPY_AND_ASSIGN(ManagerPasswordService); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace chromeos | 80 } // namespace chromeos |
| 81 #endif // CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_MANAGER_PASSWORD_SERVICE_H_ | 81 #endif // CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_MANAGER_PASSWORD_SERVICE_H_ |
| OLD | NEW |