Chromium Code Reviews| Index: chrome/browser/chromeos/login/owner_settings_service_factory.h |
| diff --git a/chrome/browser/chromeos/login/owner_settings_service_factory.h b/chrome/browser/chromeos/login/owner_settings_service_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a034fb1f0930a4042b2b017ffaa98bd38e303b81 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/login/owner_settings_service_factory.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_SETTINGS_SERVICE_FACTORY_H_ |
| +#define CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_SETTINGS_SERVICE_FACTORY_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/compiler_specific.h" |
| +#include "base/macros.h" |
| +#include "base/memory/singleton.h" |
| +#include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
| + |
| +class KeyedService; |
| +class Profile; |
| + |
| +namespace chromeos { |
| + |
| +class OwnerSettingsService; |
| + |
| +class OwnerSettingsServiceFactory : public BrowserContextKeyedServiceFactory { |
| + public: |
| + static OwnerSettingsService* GetForProfile(Profile* profile); |
| + |
| + static OwnerSettingsServiceFactory* GetInstance(); |
| + |
| + // Sets name of the user supposed to be owner. If profile for |username| |
|
Nikita (slow)
2014/05/15 12:48:58
nit: an owner
ygorshenin1
2014/05/16 12:09:37
Done.
|
| + // is ready, request to reload owner key will be sent. Otherwise, |
| + // owner key will be reloaded as soon as profile will be ready. |
| + void SetUsername(const std::string& username); |
| + |
| + // Returns the name of the user supposed to be owner. |
|
Nikita (slow)
2014/05/15 12:48:58
nit: an owner
ygorshenin1
2014/05/16 12:09:37
Done.
|
| + std::string GetUsername() const; |
| + |
| + private: |
| + friend struct DefaultSingletonTraits<OwnerSettingsServiceFactory>; |
| + |
| + OwnerSettingsServiceFactory(); |
| + virtual ~OwnerSettingsServiceFactory(); |
| + |
| + static KeyedService* BuildInstanceFor(content::BrowserContext* context); |
| + |
| + // BrowserContextKeyedBaseFactory overrides: |
| + virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; |
| + |
| + // BrowserContextKeyedServiceFactory implementation: |
| + virtual KeyedService* BuildServiceInstanceFor( |
| + content::BrowserContext* browser_context) const OVERRIDE; |
| + |
| + // Name of the user supposed to be owner. |
|
Nikita (slow)
2014/05/15 12:48:58
nit: an owner
ygorshenin1
2014/05/16 12:09:37
Done.
|
| + std::string username_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceFactory); |
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_SETTINGS_SERVICE_FACTORY_H_ |