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

Side by Side Diff: chrome/browser/media/router/event_page_request_manager_factory.cc

Issue 2949933002: [Media Router] Factor extension-related logic out of MediaRouterMojoImpl (Closed)
Patch Set: Remove includes Created 3 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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 #include "chrome/browser/media/router/event_page_request_manager_factory.h"
6
7 #include "chrome/browser/media/router/event_page_request_manager.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "extensions/browser/process_manager_factory.h"
10
11 using content::BrowserContext;
12
13 namespace media_router {
14
15 // static
16 EventPageRequestManager*
17 EventPageRequestManagerFactory::GetApiForBrowserContext(
18 BrowserContext* context) {
19 DCHECK(context);
20 // GetServiceForBrowserContext returns a KeyedService hence the static_cast<>
21 // to return a pointer to EventPageRequestManager.
22 return static_cast<EventPageRequestManager*>(
23 GetInstance()->GetServiceForBrowserContext(context, true));
24 }
25
26 // static
27 EventPageRequestManagerFactory* EventPageRequestManagerFactory::GetInstance() {
28 return base::Singleton<EventPageRequestManagerFactory>::get();
29 }
30
31 EventPageRequestManagerFactory::EventPageRequestManagerFactory()
32 : BrowserContextKeyedServiceFactory(
33 "EventPageRequestManager",
34 BrowserContextDependencyManager::GetInstance()) {
35 DependsOn(extensions::ProcessManagerFactory::GetInstance());
36 }
37
38 EventPageRequestManagerFactory::~EventPageRequestManagerFactory() = default;
39
40 KeyedService* EventPageRequestManagerFactory::BuildServiceInstanceFor(
41 BrowserContext* context) const {
42 return new EventPageRequestManager(context);
43 }
44
45 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698