OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
7 | 7 |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const extensions::Extension* GetExtensionOrAppByURL( | 107 const extensions::Extension* GetExtensionOrAppByURL( |
108 const ExtensionURLInfo& info) const; | 108 const ExtensionURLInfo& info) const; |
109 | 109 |
110 // Returns the hosted app whose web extent contains the URL. | 110 // Returns the hosted app whose web extent contains the URL. |
111 const extensions::Extension* GetHostedAppByURL( | 111 const extensions::Extension* GetHostedAppByURL( |
112 const ExtensionURLInfo& info) const; | 112 const ExtensionURLInfo& info) const; |
113 | 113 |
114 // Returns a hosted app that contains any URL that overlaps with the given | 114 // Returns a hosted app that contains any URL that overlaps with the given |
115 // extent, if one exists. | 115 // extent, if one exists. |
116 const extensions::Extension* GetHostedAppByOverlappingWebExtent( | 116 const extensions::Extension* GetHostedAppByOverlappingWebExtent( |
117 const URLPatternSet& extent) const; | 117 const extensions::URLPatternSet& extent) const; |
118 | 118 |
119 // Returns true if |new_url| is in the extent of the same extension as | 119 // Returns true if |new_url| is in the extent of the same extension as |
120 // |old_url|. Also returns true if neither URL is in an app. | 120 // |old_url|. Also returns true if neither URL is in an app. |
121 bool InSameExtent(const GURL& old_url, const GURL& new_url) const; | 121 bool InSameExtent(const GURL& old_url, const GURL& new_url) const; |
122 | 122 |
123 // Look up an Extension object by id. | 123 // Look up an Extension object by id. |
124 const extensions::Extension* GetByID(const std::string& id) const; | 124 const extensions::Extension* GetByID(const std::string& id) const; |
125 | 125 |
126 // Returns true if |info| should get extension api bindings and be permitted | 126 // Returns true if |info| should get extension api bindings and be permitted |
127 // to make api calls. Note that this is independent of what extension | 127 // to make api calls. Note that this is independent of what extension |
128 // permissions the given extension has been granted. | 128 // permissions the given extension has been granted. |
129 bool ExtensionBindingsAllowed(const ExtensionURLInfo& info) const; | 129 bool ExtensionBindingsAllowed(const ExtensionURLInfo& info) const; |
130 | 130 |
131 // Returns true if |info| is an extension page that is to be served in a | 131 // Returns true if |info| is an extension page that is to be served in a |
132 // unique sandboxed origin. | 132 // unique sandboxed origin. |
133 bool IsSandboxedPage(const ExtensionURLInfo& info) const; | 133 bool IsSandboxedPage(const ExtensionURLInfo& info) const; |
134 | 134 |
135 private: | 135 private: |
136 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet); | 136 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet); |
137 | 137 |
138 ExtensionMap extensions_; | 138 ExtensionMap extensions_; |
139 | 139 |
140 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); | 140 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); |
141 }; | 141 }; |
142 | 142 |
143 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 143 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
OLD | NEW |