Chromium Code Reviews| 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_ |