OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_FACTORY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_FACTORY_H_ |
| 7 |
| 8 #include "base/memory/singleton.h" |
| 9 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
| 10 |
| 11 class Profile; |
| 12 |
| 13 namespace chromeos { |
| 14 |
| 15 class NetworkingPrivateAPI; |
| 16 |
| 17 // This is a factory class used by the ProfileDependencyManager to instantiate |
| 18 // the private API. |
| 19 class NetworkingPrivateAPIFactory : public ProfileKeyedServiceFactory { |
| 20 public: |
| 21 // Returns the NetworkingPrivateAPI for |profile|, creating it if |
| 22 // it is not yet created. |
| 23 static NetworkingPrivateAPI* GetForProfile(Profile* profile); |
| 24 |
| 25 // Returns the NetworkingPrivateAPIFactory instance. |
| 26 static NetworkingPrivateAPIFactory* GetInstance(); |
| 27 |
| 28 protected: |
| 29 // ProfileKeyedBaseFactory overrides: |
| 30 virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; |
| 31 virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; |
| 32 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; |
| 33 |
| 34 private: |
| 35 friend struct DefaultSingletonTraits<NetworkingPrivateAPIFactory>; |
| 36 |
| 37 NetworkingPrivateAPIFactory(); |
| 38 virtual ~NetworkingPrivateAPIFactory(); |
| 39 |
| 40 // ProfileKeyedServiceFactory: |
| 41 virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile) |
| 42 const OVERRIDE; |
| 43 }; |
| 44 |
| 45 } // namespace chromeos |
| 46 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_FACTORY_H_ |
OLD | NEW |