blob: 50655214cce679b90d5dee9ba86522c4ab92b662 [file] [log] [blame]
// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SEARCH_INSTANT_SERVICE_FACTORY_H_
#define CHROME_BROWSER_SEARCH_INSTANT_SERVICE_FACTORY_H_
#include "base/memory/singleton.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile_keyed_service_factory.h"
#if BUILDFLAG(IS_ANDROID)
#error "Instant is only used on desktop";
#endif
class InstantService;
class Profile;
// Singleton that owns all InstantServices and associates them with Profiles.
class InstantServiceFactory : public ProfileKeyedServiceFactory {
public:
// Returns the InstantService for |profile|.
static InstantService* GetForProfile(Profile* profile);
static InstantServiceFactory* GetInstance();
InstantServiceFactory(const InstantServiceFactory&) = delete;
InstantServiceFactory& operator=(const InstantServiceFactory&) = delete;
private:
friend struct base::DefaultSingletonTraits<InstantServiceFactory>;
InstantServiceFactory();
~InstantServiceFactory() override;
// Overridden from BrowserContextKeyedServiceFactory:
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
};
#endif // CHROME_BROWSER_SEARCH_INSTANT_SERVICE_FACTORY_H_