Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3712)

Unified Diff: chrome/browser/chromeos/extensions/networking_private_api_factory.h

Issue 11975015: This adds a private extension API to use for simple networking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed self review nits Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/networking_private_api_factory.h
diff --git a/chrome/browser/chromeos/extensions/networking_private_api_factory.h b/chrome/browser/chromeos/extensions/networking_private_api_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..58f4184ad0ae9b8f991c27cc236dced8c99d5767
--- /dev/null
+++ b/chrome/browser/chromeos/extensions/networking_private_api_factory.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2013 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_EXTENSIONS_NETWORKING_PRIVATE_API_FACTORY_H_
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_FACTORY_H_
+
+#include "base/memory/singleton.h"
+#include "chrome/browser/profiles/profile_keyed_service_factory.h"
+
+class Profile;
+
+namespace chromeos {
+
+class NetworkingPrivateAPI;
+
+// This is a factory class used by the ProfileDependencyManager to instantiate
+// the private API.
+class NetworkingPrivateAPIFactory : public ProfileKeyedServiceFactory {
+ public:
+ // Returns the NetworkingPrivateAPI for |profile|, creating it if
+ // it is not yet created.
+ static NetworkingPrivateAPI* GetForProfile(Profile* profile);
+
+ // Returns the NetworkingPrivateAPIFactory instance.
+ static NetworkingPrivateAPIFactory* GetInstance();
+
+ protected:
+ // ProfileKeyedBaseFactory overrides:
+ virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE;
+ virtual bool ServiceIsCreatedWithProfile() const OVERRIDE;
+ virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
+
+ private:
+ friend struct DefaultSingletonTraits<NetworkingPrivateAPIFactory>;
+
+ NetworkingPrivateAPIFactory();
+ virtual ~NetworkingPrivateAPIFactory();
+
+ // ProfileKeyedServiceFactory:
+ virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile)
+ const OVERRIDE;
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698