OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_EXTENSION_PREFS_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
393 | 393 |
394 // Gets the active permission set for the specified extension. This may | 394 // Gets the active permission set for the specified extension. This may |
395 // differ from the permissions in the manifest due to the optional | 395 // differ from the permissions in the manifest due to the optional |
396 // permissions API. This passes ownership of the set to the caller. | 396 // permissions API. This passes ownership of the set to the caller. |
397 PermissionSet* GetActivePermissions(const std::string& extension_id); | 397 PermissionSet* GetActivePermissions(const std::string& extension_id); |
398 | 398 |
399 // Sets the active |permissions| for the extension with |extension_id|. | 399 // Sets the active |permissions| for the extension with |extension_id|. |
400 void SetActivePermissions(const std::string& extension_id, | 400 void SetActivePermissions(const std::string& extension_id, |
401 const PermissionSet* permissions); | 401 const PermissionSet* permissions); |
402 | 402 |
403 // Returns the persisted permission set for the extension with | |
404 // |extension_id|, and NULL if no preferences were found. This passes | |
405 // ownership of the returned set to the caller. | |
406 PermissionSet* GetPersistedPermissions(const std::string& extension_id); | |
not at google - send to devlin
2014/08/01 18:15:12
I'm not sure whether this needs to be a whole sepa
gpdavis
2014/08/01 20:06:06
But permissions from the manifest are added direct
not at google - send to devlin
2014/08/04 23:53:13
Ah - so there is a concept of "active permissions"
| |
407 | |
408 // Adds |permissions| to |extension|'s persisted permissions for script | |
409 // injection requests. | |
410 void AddPersistedPermission(const std::string& extension_id, | |
411 const PermissionSet* permissions); | |
412 | |
413 // Clears |extension|'s persisted permissions for script injection requests. | |
414 void ClearPersistedPermissions(const std::string& extension_id); | |
415 | |
403 // Records whether or not this extension is currently running. | 416 // Records whether or not this extension is currently running. |
404 void SetExtensionRunning(const std::string& extension_id, bool is_running); | 417 void SetExtensionRunning(const std::string& extension_id, bool is_running); |
405 | 418 |
406 // Returns whether or not this extension is marked as running. This is used to | 419 // Returns whether or not this extension is marked as running. This is used to |
407 // restart apps across browser restarts. | 420 // restart apps across browser restarts. |
408 bool IsExtensionRunning(const std::string& extension_id); | 421 bool IsExtensionRunning(const std::string& extension_id); |
409 | 422 |
410 // Set/Get whether or not the app is active. Used to force a launch of apps | 423 // Set/Get whether or not the app is active. Used to force a launch of apps |
411 // that don't handle onRestarted() on a restart. We can only safely do that if | 424 // that don't handle onRestarted() on a restart. We can only safely do that if |
412 // the app was active when it was last running. | 425 // the app was active when it was last running. |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
717 bool extensions_disabled_; | 730 bool extensions_disabled_; |
718 | 731 |
719 ObserverList<ExtensionPrefsObserver> observer_list_; | 732 ObserverList<ExtensionPrefsObserver> observer_list_; |
720 | 733 |
721 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 734 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
722 }; | 735 }; |
723 | 736 |
724 } // namespace extensions | 737 } // namespace extensions |
725 | 738 |
726 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ | 739 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
OLD | NEW |