OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PERMISSION_SET_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_PERMISSION_SET_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_PERMISSION_SET_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_PERMISSION_SET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 373 |
374 const URLPatternSet& scriptable_hosts() const { return scriptable_hosts_; } | 374 const URLPatternSet& scriptable_hosts() const { return scriptable_hosts_; } |
375 | 375 |
376 private: | 376 private: |
377 FRIEND_TEST_ALL_PREFIXES(ExtensionPermissionSetTest, | 377 FRIEND_TEST_ALL_PREFIXES(ExtensionPermissionSetTest, |
378 HasLessHostPrivilegesThan); | 378 HasLessHostPrivilegesThan); |
379 | 379 |
380 friend class base::RefCountedThreadSafe<ExtensionPermissionSet>; | 380 friend class base::RefCountedThreadSafe<ExtensionPermissionSet>; |
381 | 381 |
382 static std::set<std::string> GetDistinctHosts( | 382 static std::set<std::string> GetDistinctHosts( |
383 const URLPatternSet& host_patterns, bool include_rcd); | 383 const URLPatternSet& host_patterns, |
| 384 bool include_rcd, |
| 385 bool exclude_file_scheme); |
384 | 386 |
385 // Initializes the set based on |extension|'s manifest data. | 387 // Initializes the set based on |extension|'s manifest data. |
386 void InitImplicitExtensionPermissions(const Extension* extension); | 388 void InitImplicitExtensionPermissions(const Extension* extension); |
387 | 389 |
388 // Initializes the effective host permission based on the data in this set. | 390 // Initializes the effective host permission based on the data in this set. |
389 void InitEffectiveHosts(); | 391 void InitEffectiveHosts(); |
390 | 392 |
391 // Gets the permission messages for the API permissions. | 393 // Gets the permission messages for the API permissions. |
392 std::set<ExtensionPermissionMessage> GetSimplePermissionMessages() const; | 394 std::set<ExtensionPermissionMessage> GetSimplePermissionMessages() const; |
393 | 395 |
(...skipping 17 matching lines...) Expand all Loading... |
411 | 413 |
412 // The list of hosts that can be scripted by content scripts. | 414 // The list of hosts that can be scripted by content scripts. |
413 // TODO(jstritar): Rename to "user_script_hosts_"? | 415 // TODO(jstritar): Rename to "user_script_hosts_"? |
414 URLPatternSet scriptable_hosts_; | 416 URLPatternSet scriptable_hosts_; |
415 | 417 |
416 // The list of hosts this effectively grants access to. | 418 // The list of hosts this effectively grants access to. |
417 URLPatternSet effective_hosts_; | 419 URLPatternSet effective_hosts_; |
418 }; | 420 }; |
419 | 421 |
420 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_PERMISSION_SET_H_ | 422 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_PERMISSION_SET_H_ |
OLD | NEW |