Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Side by Side Diff: extensions/browser/extension_prefs.h

Issue 396033002: Support "always allow" for runtime script execution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test attempt Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Populates |persisted_permissions| with the persisted permissions for the
404 // extension with |extension_id|, returning true on success.
405 bool GetPersistedPermissions(const std::string& extension_id,
406 URLPatternSet* persisted_permissions);
407
408 // Adds |pattern| to |extension|'s persisted permissions for script injection
409 // requests.
410 void AddPersistedPermission(const Extension* extension,
411 const URLPattern* pattern);
412
413 // Clears |extension|'s persisted permissions for script injection requests.
414 void ClearPersistedPermissions(const Extension* extension);
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 bool extensions_disabled_; 725 bool extensions_disabled_;
713 726
714 ObserverList<ExtensionPrefsObserver> observer_list_; 727 ObserverList<ExtensionPrefsObserver> observer_list_;
715 728
716 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); 729 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs);
717 }; 730 };
718 731
719 } // namespace extensions 732 } // namespace extensions
720 733
721 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ 734 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698