networking_private_service_client_factory.h revision f2477e01787aa58f445919b809d89e252beef54f
1// Copyright 2013 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_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_SERVICE_CLIENT_FACTORY_H_
6#define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_SERVICE_CLIENT_FACTORY_H_
7
8#include "base/memory/singleton.h"
9#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
10
11class Profile;
12
13namespace extensions {
14
15class NetworkingPrivateServiceClient;
16
17class NetworkingPrivateServiceClientFactory
18    : public BrowserContextKeyedServiceFactory {
19 public:
20  static NetworkingPrivateServiceClient* GetForProfile(Profile* profile);
21
22  static NetworkingPrivateServiceClientFactory* GetInstance();
23
24 private:
25  friend struct DefaultSingletonTraits<NetworkingPrivateServiceClientFactory>;
26
27  NetworkingPrivateServiceClientFactory();
28  virtual ~NetworkingPrivateServiceClientFactory();
29
30  // BrowserContextKeyedServiceFactory:
31  virtual BrowserContextKeyedService*
32      BuildServiceInstanceFor(content::BrowserContext* profile) const OVERRIDE;
33  virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
34  virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
35
36  DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateServiceClientFactory);
37};
38
39}  // namespace extensions
40
41#endif  // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_SERVICE_CLIENT_FACTORY_H_
42