OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef EXTENSIONS_COMMON_EXTENSION_SET_H_ | 5 #ifndef EXTENSIONS_COMMON_EXTENSION_SET_H_ |
6 #define EXTENSIONS_COMMON_EXTENSION_SET_H_ | 6 #define EXTENSIONS_COMMON_EXTENSION_SET_H_ |
7 | 7 |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // are part of an extension's web extent. | 94 // are part of an extension's web extent. |
95 std::string GetExtensionOrAppIDByURL(const GURL& url) const; | 95 std::string GetExtensionOrAppIDByURL(const GURL& url) const; |
96 | 96 |
97 // Returns the Extension, or NULL if none. This includes web URLs that are | 97 // Returns the Extension, or NULL if none. This includes web URLs that are |
98 // part of an extension's web extent. | 98 // part of an extension's web extent. |
99 // NOTE: This can return NULL if called before UpdateExtensions receives | 99 // NOTE: This can return NULL if called before UpdateExtensions receives |
100 // bulk extension data (e.g. if called from | 100 // bulk extension data (e.g. if called from |
101 // EventBindings::HandleContextCreated) | 101 // EventBindings::HandleContextCreated) |
102 const Extension* GetExtensionOrAppByURL(const GURL& url) const; | 102 const Extension* GetExtensionOrAppByURL(const GURL& url) const; |
103 | 103 |
| 104 // Returns the app specified by the given |url|, if one exists. This will |
| 105 // return NULL if there is no entry with |url|, or if the extension with |
| 106 // |url| is not an app. |
| 107 const Extension* GetAppByURL(const GURL& url) const; |
| 108 |
104 // Returns the hosted app whose web extent contains the URL. | 109 // Returns the hosted app whose web extent contains the URL. |
105 const Extension* GetHostedAppByURL(const GURL& url) const; | 110 const Extension* GetHostedAppByURL(const GURL& url) const; |
106 | 111 |
107 // Returns a hosted app that contains any URL that overlaps with the given | 112 // Returns a hosted app that contains any URL that overlaps with the given |
108 // extent, if one exists. | 113 // extent, if one exists. |
109 const Extension* GetHostedAppByOverlappingWebExtent( | 114 const Extension* GetHostedAppByOverlappingWebExtent( |
110 const URLPatternSet& extent) const; | 115 const URLPatternSet& extent) const; |
111 | 116 |
112 // Returns true if |new_url| is in the extent of the same extension as | 117 // Returns true if |new_url| is in the extent of the same extension as |
113 // |old_url|. Also returns true if neither URL is in an app. | 118 // |old_url|. Also returns true if neither URL is in an app. |
(...skipping 25 matching lines...) Expand all Loading... |
139 // discarding the set (e.g., on shutdown) and we do not want to track that as | 144 // discarding the set (e.g., on shutdown) and we do not want to track that as |
140 // a real modification. | 145 // a real modification. |
141 ModificationCallback modification_callback_; | 146 ModificationCallback modification_callback_; |
142 | 147 |
143 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); | 148 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); |
144 }; | 149 }; |
145 | 150 |
146 } // namespace extensions | 151 } // namespace extensions |
147 | 152 |
148 #endif // EXTENSIONS_COMMON_EXTENSION_SET_H_ | 153 #endif // EXTENSIONS_COMMON_EXTENSION_SET_H_ |
OLD | NEW |