1cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 2cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// found in the LICENSE file. 4cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 51320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTORY_H_ 61320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTORY_H_ 7cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "base/compiler_specific.h" 9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "base/macros.h" 101320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "base/memory/ref_counted.h" 11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "base/memory/singleton.h" 12cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "components/keyed_service/content/browser_context_keyed_service_factory.h" 13cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 14cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)class KeyedService; 15cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)class Profile; 16cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 171320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tuccinamespace ownership { 181320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass OwnerKeyUtil; 191320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci} 201320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci 21cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)namespace chromeos { 22cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 231320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass OwnerSettingsServiceChromeOS; 24cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 251320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass OwnerSettingsServiceChromeOSFactory 261320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci : public BrowserContextKeyedServiceFactory { 27cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) public: 281320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci static OwnerSettingsServiceChromeOS* GetForProfile(Profile* profile); 291320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci 301320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci static OwnerSettingsServiceChromeOSFactory* GetInstance(); 31cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 321320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci scoped_refptr<ownership::OwnerKeyUtil> GetOwnerKeyUtil(); 331320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci 341320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci void SetOwnerKeyUtilForTesting( 351320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); 36cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 37cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) private: 381320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci friend struct DefaultSingletonTraits<OwnerSettingsServiceChromeOSFactory>; 39cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 401320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci OwnerSettingsServiceChromeOSFactory(); 411320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci virtual ~OwnerSettingsServiceChromeOSFactory(); 42cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 43cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) static KeyedService* BuildInstanceFor(content::BrowserContext* context); 44cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 45cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // BrowserContextKeyedBaseFactory overrides: 46cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; 47cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 48cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // BrowserContextKeyedServiceFactory implementation: 49cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual KeyedService* BuildServiceInstanceFor( 50cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) content::BrowserContext* browser_context) const OVERRIDE; 51cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 521320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci scoped_refptr<ownership::OwnerKeyUtil> owner_key_util_; 531320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci 541320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOSFactory); 55cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)}; 56cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 57cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)} // namespace chromeos 58cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 591320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTORY_H_ 60