OLD | NEW |
---|---|
(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/renderer/renderer_extension_registry.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "base/stl_util.h" | |
Devlin
2015/08/18 15:40:55
?
annekao
2015/08/18 17:43:31
Done.
| |
9 #include "extensions/common/constants.h" | |
Devlin
2015/08/18 15:40:55
?
| |
10 #include "extensions/common/extension.h" | |
Devlin
2015/08/18 15:40:55
might not even need this one...
| |
11 #include "extensions/common/manifest_handlers/sandboxed_page_info.h" | |
Devlin
2015/08/18 15:40:55
?
| |
12 | |
13 namespace extensions { | |
14 | |
15 namespace { | |
16 | |
17 base::LazyInstance<RendererExtensionRegistry> g_renderer_extension_registry = | |
18 LAZY_INSTANCE_INITIALIZER; | |
19 } | |
20 | |
21 RendererExtensionRegistry::RendererExtensionRegistry() {} | |
22 | |
23 RendererExtensionRegistry::~RendererExtensionRegistry() {} | |
24 | |
25 // static | |
26 RendererExtensionRegistry* RendererExtensionRegistry::Get() { | |
27 return g_renderer_extension_registry.Pointer(); | |
28 } | |
29 | |
30 const ExtensionSet* RendererExtensionRegistry::GetMainThreadExtensionSet() | |
31 const { | |
32 base::AutoLock lock(lock_); | |
33 return &extensions_; | |
34 } | |
35 | |
36 size_t RendererExtensionRegistry::size() const { | |
37 base::AutoLock lock(lock_); | |
38 return extensions_.size(); | |
39 } | |
40 | |
41 bool RendererExtensionRegistry::is_empty() const { | |
42 base::AutoLock lock(lock_); | |
43 return extensions_.is_empty(); | |
44 } | |
45 | |
46 bool RendererExtensionRegistry::Contains( | |
47 const std::string& extension_id) const { | |
48 base::AutoLock lock(lock_); | |
49 return extensions_.Contains(extension_id); | |
50 } | |
51 | |
52 bool RendererExtensionRegistry::Insert( | |
53 const scoped_refptr<const Extension>& extension) { | |
54 base::AutoLock lock(lock_); | |
55 return extensions_.Insert(extension); | |
56 } | |
57 | |
58 bool RendererExtensionRegistry::Remove(const std::string& id) { | |
59 base::AutoLock lock(lock_); | |
60 return extensions_.Remove(id); | |
61 } | |
62 | |
63 std::string RendererExtensionRegistry::GetExtensionOrAppIDByURL( | |
64 const GURL& url) const { | |
65 base::AutoLock lock(lock_); | |
66 return extensions_.GetExtensionOrAppIDByURL(url); | |
67 } | |
68 | |
69 const Extension* RendererExtensionRegistry::GetExtensionOrAppByURL( | |
70 const GURL& url) const { | |
71 base::AutoLock lock(lock_); | |
72 return extensions_.GetExtensionOrAppByURL(url); | |
73 } | |
74 | |
75 const Extension* RendererExtensionRegistry::GetHostedAppByURL( | |
76 const GURL& url) const { | |
77 base::AutoLock lock(lock_); | |
78 return extensions_.GetHostedAppByURL(url); | |
79 } | |
80 | |
81 const Extension* RendererExtensionRegistry::GetByID( | |
82 const std::string& id) const { | |
83 base::AutoLock lock(lock_); | |
84 return extensions_.GetByID(id); | |
85 } | |
86 | |
87 ExtensionIdSet RendererExtensionRegistry::GetIDs() const { | |
88 base::AutoLock lock(lock_); | |
89 return extensions_.GetIDs(); | |
90 } | |
91 | |
92 bool RendererExtensionRegistry::ExtensionBindingsAllowed( | |
93 const GURL& url) const { | |
94 base::AutoLock lock(lock_); | |
95 return extensions_.ExtensionBindingsAllowed(url); | |
96 } | |
97 | |
98 } // namespace extensions | |
OLD | NEW |