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