OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" |
| 11 #include "components/keyed_service/core/keyed_service.h" |
| 12 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" |
| 14 |
| 15 class Profile; |
| 16 |
| 17 namespace chromeos { |
| 18 |
| 19 // This class reloads owner key from profile NSS slots. |
| 20 // |
| 21 // TODO (ygorshenin@): move write path for device settings here |
| 22 // (crbug.com/230018). |
| 23 class OwnerSettingsService : public KeyedService, |
| 24 public content::NotificationObserver { |
| 25 public: |
| 26 virtual ~OwnerSettingsService(); |
| 27 |
| 28 // NotificationObserver implementation: |
| 29 virtual void Observe(int type, |
| 30 const content::NotificationSource& source, |
| 31 const content::NotificationDetails& details) OVERRIDE; |
| 32 |
| 33 private: |
| 34 friend class OwnerSettingsServiceFactory; |
| 35 |
| 36 explicit OwnerSettingsService(Profile* profile); |
| 37 |
| 38 void ReloadOwnerKey(); |
| 39 |
| 40 Profile* profile_; |
| 41 |
| 42 content::NotificationRegistrar registrar_; |
| 43 |
| 44 base::WeakPtrFactory<OwnerSettingsService> weak_factory_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsService); |
| 47 }; |
| 48 |
| 49 } // namespace chromeos |
| 50 |
| 51 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ |
OLD | NEW |