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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_MANAGED_MODE_CHROMEOS_MANAGED_USER_PASSWORD_SERVICE_H_
6 #define CHROME_BROWSER_MANAGED_MODE_CHROMEOS_MANAGED_USER_PASSWORD_SERVICE_H_
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/managed_mode/managed_user_shared_settings_service.h"
14 #include "chrome/browser/managed_mode/managed_users.h"
15 #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
17 class ManagedUserPasswordService : public BrowserContextKeyedService {
19 ManagedUserPasswordService();
20 virtual ~ManagedUserPasswordService();
22 virtual void Shutdown() OVERRIDE;
24 void Init(const std::string& user_id,
25 ManagedUserSharedSettingsService* service);
27 void OnSharedSettingsChange(const std::string& mu_id, const std::string& key);
29 // Cached value from Init().
30 // User id of currently logged in managed user.
32 ManagedUserSharedSettingsService* settings_service_;
34 scoped_ptr<ManagedUserSharedSettingsService::ChangeCallbackList::Subscription>
35 settings_service_subscription_;
37 base::WeakPtrFactory<ManagedUserPasswordService> weak_ptr_factory_;
39 DISALLOW_COPY_AND_ASSIGN(ManagedUserPasswordService);
42 #endif // CHROME_BROWSER_MANAGED_MODE_CHROMEOS_MANAGED_USER_PASSWORD_SERVICE_H_