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