| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 // Gets the active permission set for the specified extension. This may | 263 // Gets the active permission set for the specified extension. This may |
| 264 // differ from the permissions in the manifest due to the optional | 264 // differ from the permissions in the manifest due to the optional |
| 265 // permissions API. This passes ownership of the set to the caller. | 265 // permissions API. This passes ownership of the set to the caller. |
| 266 PermissionSet* GetActivePermissions(const std::string& extension_id); | 266 PermissionSet* GetActivePermissions(const std::string& extension_id); |
| 267 | 267 |
| 268 // Sets the active |permissions| for the extension with |extension_id|. | 268 // Sets the active |permissions| for the extension with |extension_id|. |
| 269 void SetActivePermissions(const std::string& extension_id, | 269 void SetActivePermissions(const std::string& extension_id, |
| 270 const PermissionSet* permissions); | 270 const PermissionSet* permissions); |
| 271 | 271 |
| 272 // Returns true if registered events are from this version of Chrome. Else, |
| 273 // clear them, and return false. |
| 274 bool CheckRegisteredEventsUpToDate(); |
| 275 |
| 272 // Returns the list of events that the given extension has registered for. | 276 // Returns the list of events that the given extension has registered for. |
| 273 std::set<std::string> GetRegisteredEvents(const std::string& extension_id); | 277 std::set<std::string> GetRegisteredEvents(const std::string& extension_id); |
| 274 void SetRegisteredEvents(const std::string& extension_id, | 278 void SetRegisteredEvents(const std::string& extension_id, |
| 275 const std::set<std::string>& events); | 279 const std::set<std::string>& events); |
| 276 | 280 |
| 277 // Adds a filter to an event. | 281 // Adds a filter to an event. |
| 278 void AddFilterToEvent(const std::string& event_name, | 282 void AddFilterToEvent(const std::string& event_name, |
| 279 const std::string& extension_id, | 283 const std::string& extension_id, |
| 280 const DictionaryValue* filter); | 284 const DictionaryValue* filter); |
| 281 | 285 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 // Installs the persistent extension preferences into |prefs_|'s extension | 538 // Installs the persistent extension preferences into |prefs_|'s extension |
| 535 // pref store. Does nothing if |extensions_disabled| is true. | 539 // pref store. Does nothing if |extensions_disabled| is true. |
| 536 void InitPrefStore(bool extensions_disabled); | 540 void InitPrefStore(bool extensions_disabled); |
| 537 | 541 |
| 538 // Migrates the permissions data in the pref store. | 542 // Migrates the permissions data in the pref store. |
| 539 void MigratePermissions(const ExtensionIds& extension_ids); | 543 void MigratePermissions(const ExtensionIds& extension_ids); |
| 540 | 544 |
| 541 // Migrates the disable reasons from a single enum to a bit mask. | 545 // Migrates the disable reasons from a single enum to a bit mask. |
| 542 void MigrateDisableReasons(const ExtensionIds& extension_ids); | 546 void MigrateDisableReasons(const ExtensionIds& extension_ids); |
| 543 | 547 |
| 548 // Clears the registered events for event pages. |
| 549 void ClearRegisteredEvents(); |
| 550 |
| 544 // Checks whether there is a state pref for the extension and if so, whether | 551 // Checks whether there is a state pref for the extension and if so, whether |
| 545 // it matches |check_state|. | 552 // it matches |check_state|. |
| 546 bool DoesExtensionHaveState(const std::string& id, | 553 bool DoesExtensionHaveState(const std::string& id, |
| 547 Extension::State check_state) const; | 554 Extension::State check_state) const; |
| 548 | 555 |
| 549 // Helper function to Get/Set array of strings from/to prefs. | 556 // Helper function to Get/Set array of strings from/to prefs. |
| 550 ExtensionIds GetExtensionPrefAsVector(const char* pref); | 557 ExtensionIds GetExtensionPrefAsVector(const char* pref); |
| 551 void SetExtensionPrefFromVector(const char* pref, | 558 void SetExtensionPrefFromVector(const char* pref, |
| 552 const ExtensionIds& extension_ids); | 559 const ExtensionIds& extension_ids); |
| 553 | 560 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 565 scoped_ptr<ExtensionSorting> extension_sorting_; | 572 scoped_ptr<ExtensionSorting> extension_sorting_; |
| 566 | 573 |
| 567 scoped_refptr<ContentSettingsStore> content_settings_store_; | 574 scoped_refptr<ContentSettingsStore> content_settings_store_; |
| 568 | 575 |
| 569 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 576 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
| 570 }; | 577 }; |
| 571 | 578 |
| 572 } // namespace extensions | 579 } // namespace extensions |
| 573 | 580 |
| 574 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 581 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| OLD | NEW |