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

Side by Side Diff: extensions/browser/api/display_source/display_source_connection_delegate_factory.cc

Issue 1410093008: Introduce chrome.displaySource API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from Antony Created 5 years, 1 month 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 2015 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 "extensions/browser/api/display_source/display_source_connection_delega te_factory.h"
6
7 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "content/public/browser/browser_thread.h"
9 #include "extensions/browser/extensions_browser_client.h"
10
11 namespace extensions {
12
13 using content::BrowserContext;
14
15 // static
16 DisplaySourceConnectionDelegate*
17 DisplaySourceConnectionDelegateFactory::GetForBrowserContext(
18 BrowserContext* browser_context) {
19 return static_cast<DisplaySourceConnectionDelegate*>(
20 GetInstance()->GetServiceForBrowserContext(browser_context, true));
21 }
22
23 // static
24 DisplaySourceConnectionDelegateFactory*
25 DisplaySourceConnectionDelegateFactory::GetInstance() {
26 return base::Singleton<DisplaySourceConnectionDelegateFactory>::get();
27 }
28
29 DisplaySourceConnectionDelegateFactory::DisplaySourceConnectionDelegateFactory()
30 : BrowserContextKeyedServiceFactory(
31 "DisplaySourceConnectionDelegate",
32 BrowserContextDependencyManager::GetInstance()) {}
33
34 DisplaySourceConnectionDelegateFactory::
35 ~DisplaySourceConnectionDelegateFactory() {}
36
37 KeyedService* DisplaySourceConnectionDelegateFactory::BuildServiceInstanceFor(
38 BrowserContext* browser_context) const {
39 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
40
41 DisplaySourceConnectionDelegate* delegate = nullptr;
42 // TODO(mikhail): Add implementation.
43 return delegate;
44 }
45
46 BrowserContext* DisplaySourceConnectionDelegateFactory::GetBrowserContextToUse(
47 BrowserContext* context) const {
48 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
49 }
50
51 bool DisplaySourceConnectionDelegateFactory::
52 ServiceIsCreatedWithBrowserContext() const {
53 return false;
54 }
55
56 bool DisplaySourceConnectionDelegateFactory::ServiceIsNULLWhileTesting() const {
57 return false;
58 }
59
60 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698