| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 // exist. | 522 // exist. |
| 523 const base::DictionaryValue* GetExtensionPref(const std::string& id) const; | 523 const base::DictionaryValue* GetExtensionPref(const std::string& id) const; |
| 524 | 524 |
| 525 // Returns the dictionary of preferences controlled by the specified extension | 525 // Returns the dictionary of preferences controlled by the specified extension |
| 526 // or creates a new one. All entries in the dictionary contain non-expanded | 526 // or creates a new one. All entries in the dictionary contain non-expanded |
| 527 // paths. | 527 // paths. |
| 528 const base::DictionaryValue* GetExtensionControlledPrefs( | 528 const base::DictionaryValue* GetExtensionControlledPrefs( |
| 529 const std::string& id, | 529 const std::string& id, |
| 530 bool incognito) const; | 530 bool incognito) const; |
| 531 | 531 |
| 532 // Serializes the data and schedules a persistent save via the |PrefService|. | |
| 533 // TODO(andybons): Fire an EXTENSION_PREF_CHANGED notification to be more | |
| 534 // granular than PREF_CHANGED. | |
| 535 void SavePrefs(); | |
| 536 | |
| 537 // Checks if kPrefBlacklist is set to true in the DictionaryValue. | 532 // Checks if kPrefBlacklist is set to true in the DictionaryValue. |
| 538 // Return false if the value is false or kPrefBlacklist does not exist. | 533 // Return false if the value is false or kPrefBlacklist does not exist. |
| 539 // This is used to decide if an extension is blacklisted. | 534 // This is used to decide if an extension is blacklisted. |
| 540 static bool IsBlacklistBitSet(base::DictionaryValue* ext); | 535 static bool IsBlacklistBitSet(base::DictionaryValue* ext); |
| 541 | 536 |
| 542 // Fix missing preference entries in the extensions that are were introduced | 537 // Fix missing preference entries in the extensions that are were introduced |
| 543 // in a later Chrome version. | 538 // in a later Chrome version. |
| 544 void FixMissingPrefs(const ExtensionIdSet& extension_ids); | 539 void FixMissingPrefs(const ExtensionIdSet& extension_ids); |
| 545 | 540 |
| 546 // Installs the persistent extension preferences into |prefs_|'s extension | 541 // Installs the persistent extension preferences into |prefs_|'s extension |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 | 593 |
| 599 // Weak pointer, owned by Profile. | 594 // Weak pointer, owned by Profile. |
| 600 ExtensionPrefValueMap* extension_pref_value_map_; | 595 ExtensionPrefValueMap* extension_pref_value_map_; |
| 601 | 596 |
| 602 scoped_refptr<ExtensionContentSettingsStore> content_settings_store_; | 597 scoped_refptr<ExtensionContentSettingsStore> content_settings_store_; |
| 603 | 598 |
| 604 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 599 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
| 605 }; | 600 }; |
| 606 | 601 |
| 607 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 602 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| OLD | NEW |