OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 // Returns true if the extension has the specified API permission. | 272 // Returns true if the extension has the specified API permission. |
273 bool HasApiPermission(const std::string& permission) const { | 273 bool HasApiPermission(const std::string& permission) const { |
274 return std::find(api_permissions_.begin(), api_permissions_.end(), | 274 return std::find(api_permissions_.begin(), api_permissions_.end(), |
275 permission) != api_permissions_.end(); | 275 permission) != api_permissions_.end(); |
276 } | 276 } |
277 | 277 |
278 // Returns the set of hosts that the extension effectively has access to. This | 278 // Returns the set of hosts that the extension effectively has access to. This |
279 // is used in the permissions UI and is a combination of the hosts accessible | 279 // is used in the permissions UI and is a combination of the hosts accessible |
280 // through content scripts and the hosts accessible through XHR. | 280 // through content scripts and the hosts accessible through XHR. |
281 const ExtensionExtent GetEffectiveHostPermissions() const; | 281 const std::set<std::string> GetEffectiveHostPermissions() const; |
282 | 282 |
283 // Whether or not the extension is allowed permission for a URL pattern from | 283 // Whether or not the extension is allowed permission for a URL pattern from |
284 // the manifest. http, https, and chrome://favicon/ is allowed for all | 284 // the manifest. http, https, and chrome://favicon/ is allowed for all |
285 // extensions, while component extensions are allowed access to | 285 // extensions, while component extensions are allowed access to |
286 // chrome://resources. | 286 // chrome://resources. |
287 bool CanAccessURL(const URLPattern pattern) const; | 287 bool CanAccessURL(const URLPattern pattern) const; |
288 | 288 |
289 // Whether the extension has access to the given URL. | 289 // Whether the extension has access to the given URL. |
290 bool HasHostPermission(const GURL& url) const; | 290 bool HasHostPermission(const GURL& url) const; |
291 | 291 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 scoped_ptr<DictionaryValue> extension_manifest; | 603 scoped_ptr<DictionaryValue> extension_manifest; |
604 std::string extension_id; | 604 std::string extension_id; |
605 FilePath extension_path; | 605 FilePath extension_path; |
606 Extension::Location extension_location; | 606 Extension::Location extension_location; |
607 | 607 |
608 private: | 608 private: |
609 DISALLOW_COPY_AND_ASSIGN(ExtensionInfo); | 609 DISALLOW_COPY_AND_ASSIGN(ExtensionInfo); |
610 }; | 610 }; |
611 | 611 |
612 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 612 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |