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

Unified Diff: chrome/browser/tether/tether_service_factory.h

Issue 2819713002: Create TetherService, a TetherAllowed pref, and use DependencyManager for RegisterProfilePrefs call… (Closed)
Patch Set: Do not explicitly call on TetherService::Shutdown() from UserSessionManager. Created 3 years, 8 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/tether/tether_service_factory.h
diff --git a/chrome/browser/tether/tether_service_factory.h b/chrome/browser/tether/tether_service_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..bddabd95d0a22d131412408193f6fe05f1fcb389
--- /dev/null
+++ b/chrome/browser/tether/tether_service_factory.h
@@ -0,0 +1,44 @@
+// Copyright 2017 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_TETHER_TETHER_SERVICE_FACTORY_H_
+#define CHROME_BROWSER_TETHER_TETHER_SERVICE_FACTORY_H_
+
+#include "base/macros.h"
+#include "chrome/browser/tether/tether_service.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+namespace content {
+class BrowserContext;
+}
+
+namespace base {
+template <typename T>
+struct DefaultSingletonTraits;
+}
+
+// Singleton factory that builds and owns all TetherServices.
+class TetherServiceFactory : public BrowserContextKeyedServiceFactory {
+ public:
+ static TetherServiceFactory* GetInstance();
+
+ static TetherService* GetForBrowserContext(
+ content::BrowserContext* browser_context);
+
+ private:
+ friend struct base::DefaultSingletonTraits<TetherServiceFactory>;
+
+ TetherServiceFactory();
+ ~TetherServiceFactory() override;
+
+ // BrowserContextKeyedServiceFactory:
+ KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const override;
+ void RegisterProfilePrefs(
+ user_prefs::PrefRegistrySyncable* registry) override;
+
+ DISALLOW_COPY_AND_ASSIGN(TetherServiceFactory);
+};
+
+#endif // CHROME_BROWSER_TETHER_TETHER_SERVICE_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698