| 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_SUPERVISED_USER_PASSWORD_SERVICE
_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_SUPERVISED_USER_PASSWORD_SERVICE
_H_ |
| 6 #define CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_SUPERVISED_USER_PASSWORD_SERVICE
_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_SUPERVISED_USER_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/supervised_users.h" | 15 #include "chrome/browser/supervised_user/supervised_users.h" |
| 16 #include "components/keyed_service/core/keyed_service.h" | 16 #include "components/keyed_service/core/keyed_service.h" |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 class SupervisedUserPasswordService : public KeyedService { | 20 class SupervisedUserPasswordService : public KeyedService { |
| 21 public: | 21 public: |
| 22 SupervisedUserPasswordService(); | 22 SupervisedUserPasswordService(); |
| 23 ~SupervisedUserPasswordService() override; | 23 ~SupervisedUserPasswordService() override; |
| 24 | 24 |
| 25 void Shutdown() override; | 25 void Shutdown() override; |
| 26 | 26 |
| 27 void Init(const std::string& user_id, | 27 void Init(const std::string& user_id, |
| 28 SupervisedUserSharedSettingsService* service); | 28 SupervisedUserSharedSettingsService* service); |
| 29 private: | 29 private: |
| 30 void OnSharedSettingsChange(const std::string& su_id, const std::string& key); | 30 void OnSharedSettingsChange(const std::string& su_id, const std::string& key); |
| 31 | 31 |
| 32 // Cached value from Init(). | 32 // Cached value from Init(). |
| 33 // User id of currently logged in supervised user. | 33 // User id of currently logged in supervised user. |
| 34 std::string user_id_; | 34 std::string user_id_; |
| 35 SupervisedUserSharedSettingsService* settings_service_; | 35 SupervisedUserSharedSettingsService* settings_service_; |
| 36 | 36 |
| 37 scoped_ptr<SupervisedUserSharedSettingsService::ChangeCallbackList:: | 37 std::unique_ptr< |
| 38 Subscription> | 38 SupervisedUserSharedSettingsService::ChangeCallbackList::Subscription> |
| 39 settings_service_subscription_; | 39 settings_service_subscription_; |
| 40 | 40 |
| 41 base::WeakPtrFactory<SupervisedUserPasswordService> weak_ptr_factory_; | 41 base::WeakPtrFactory<SupervisedUserPasswordService> weak_ptr_factory_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(SupervisedUserPasswordService); | 43 DISALLOW_COPY_AND_ASSIGN(SupervisedUserPasswordService); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // namespace chromeos | 46 } // namespace chromeos |
| 47 #endif // CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_SUPERVISED_USER_PASSWORD_SERV
ICE_H_ | 47 #endif // CHROME_BROWSER_SUPERVISED_USER_CHROMEOS_SUPERVISED_USER_PASSWORD_SERV
ICE_H_ |
| OLD | NEW |