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

Unified Diff: chrome/browser/media/router/media_router_impl_factory.h

Issue 1020743003: [Media Router] Design MediaRouter interface with stub implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm dependency on helper function in chrome_browser Created 5 years, 9 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/media/router/media_router_impl_factory.h
diff --git a/chrome/browser/media/router/media_router_impl_factory.h b/chrome/browser/media/router/media_router_impl_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c62d30f3ad5b2e632c0c0383afb7aef0c3b43e8
--- /dev/null
+++ b/chrome/browser/media/router/media_router_impl_factory.h
@@ -0,0 +1,44 @@
+// Copyright 2015 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_MEDIA_ROUTER_MEDIA_ROUTER_IMPL_FACTORY_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_IMPL_FACTORY_H_
+
+#include "base/memory/singleton.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+namespace content {
+class BrowserContext;
+} // namespace content
+
+namespace media_router {
+
+class MediaRouterImpl;
+
+// A factory that lazily creates and/or returns a MediaRouter object on a
mark a. foltz 2015/03/31 22:10:24 that returns a .... basis (creating one lazily if
imcheng 2015/04/01 00:55:16 Done.
+// per BrowserContext basis.
+class MediaRouterImplFactory : public BrowserContextKeyedServiceFactory {
+ public:
+ static MediaRouterImpl* GetMediaRouterForBrowserContext(
+ content::BrowserContext* context);
+ static MediaRouterImplFactory* GetInstance();
+
+ private:
+ friend struct DefaultSingletonTraits<MediaRouterImplFactory>;
+
+ MediaRouterImplFactory();
+ ~MediaRouterImplFactory() override;
+
+ // BrowserContextKeyedBaseFactory
+ KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const override;
+ content::BrowserContext* GetBrowserContextToUse(
+ content::BrowserContext* context) const override;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaRouterImplFactory);
+};
+
+} // namespace media_router
+
+#endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_IMPL_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698