Chromium Code Reviews| 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 <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 void ReplaceDisableReasons(const std::string& extension_id, | 273 void ReplaceDisableReasons(const std::string& extension_id, |
| 274 int disable_reasons); | 274 int disable_reasons); |
| 275 void ClearDisableReasons(const std::string& extension_id); | 275 void ClearDisableReasons(const std::string& extension_id); |
| 276 | 276 |
| 277 // Gets the set of extensions that have been blacklisted in prefs. This will | 277 // Gets the set of extensions that have been blacklisted in prefs. This will |
| 278 // return only the blocked extensions, not the "greylist" extensions. | 278 // return only the blocked extensions, not the "greylist" extensions. |
| 279 // TODO(oleg): Make method names consistent here, in extension service and in | 279 // TODO(oleg): Make method names consistent here, in extension service and in |
| 280 // blacklist. | 280 // blacklist. |
| 281 std::set<std::string> GetBlacklistedExtensions() const; | 281 std::set<std::string> GetBlacklistedExtensions() const; |
| 282 | 282 |
| 283 // Sets whether the extension with |id| is blacklisted. | |
| 284 void SetExtensionBlacklisted(const std::string& extension_id, | |
| 285 bool is_blacklisted); | |
| 286 | |
| 287 // Returns the version string for the currently installed extension, or | 283 // Returns the version string for the currently installed extension, or |
| 288 // the empty string if not found. | 284 // the empty string if not found. |
| 289 std::string GetVersionString(const std::string& extension_id) const; | 285 std::string GetVersionString(const std::string& extension_id) const; |
| 290 | 286 |
| 291 // Re-writes the extension manifest into the prefs. | 287 // Re-writes the extension manifest into the prefs. |
| 292 // Called to change the extension's manifest when it's re-localized. | 288 // Called to change the extension's manifest when it's re-localized. |
| 293 void UpdateManifest(const Extension* extension); | 289 void UpdateManifest(const Extension* extension); |
| 294 | 290 |
| 295 // Returns base extensions install directory. | 291 // Returns base extensions install directory. |
| 296 const base::FilePath& install_directory() const { return install_directory_; } | 292 const base::FilePath& install_directory() const { return install_directory_; } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 const std::string& extension_id, | 577 const std::string& extension_id, |
| 582 const base::DictionaryValue* extension) const; | 578 const base::DictionaryValue* extension) const; |
| 583 | 579 |
| 584 // Interprets the list pref, |pref_key| in |extension_id|'s preferences, as a | 580 // Interprets the list pref, |pref_key| in |extension_id|'s preferences, as a |
| 585 // URLPatternSet. The |valid_schemes| specify how to parse the URLPatterns. | 581 // URLPatternSet. The |valid_schemes| specify how to parse the URLPatterns. |
| 586 bool ReadPrefAsURLPatternSet(const std::string& extension_id, | 582 bool ReadPrefAsURLPatternSet(const std::string& extension_id, |
| 587 const std::string& pref_key, | 583 const std::string& pref_key, |
| 588 URLPatternSet* result, | 584 URLPatternSet* result, |
| 589 int valid_schemes) const; | 585 int valid_schemes) const; |
| 590 | 586 |
| 587 // Sets whether the extension with |id| is blacklisted. | |
|
Devlin
2016/07/18 16:22:17
Can you add here:
// DEPRECATED. Use GetExtensionB
| |
| 588 void SetExtensionBlacklisted(const std::string& extension_id, | |
| 589 bool is_blacklisted); | |
| 590 | |
| 591 // Converts |new_value| to a list of strings and sets the |pref_key| pref | 591 // Converts |new_value| to a list of strings and sets the |pref_key| pref |
| 592 // belonging to |extension_id|. | 592 // belonging to |extension_id|. |
| 593 void SetExtensionPrefURLPatternSet(const std::string& extension_id, | 593 void SetExtensionPrefURLPatternSet(const std::string& extension_id, |
| 594 const std::string& pref_key, | 594 const std::string& pref_key, |
| 595 const URLPatternSet& new_value); | 595 const URLPatternSet& new_value); |
| 596 | 596 |
| 597 // Read the boolean preference entry and return true if the preference exists | 597 // Read the boolean preference entry and return true if the preference exists |
| 598 // and the preference's value is true; false otherwise. | 598 // and the preference's value is true; false otherwise. |
| 599 bool ReadPrefAsBooleanAndReturn(const std::string& extension_id, | 599 bool ReadPrefAsBooleanAndReturn(const std::string& extension_id, |
| 600 const std::string& key) const; | 600 const std::string& key) const; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 687 bool extensions_disabled_; | 687 bool extensions_disabled_; |
| 688 | 688 |
| 689 base::ObserverList<ExtensionPrefsObserver> observer_list_; | 689 base::ObserverList<ExtensionPrefsObserver> observer_list_; |
| 690 | 690 |
| 691 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 691 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
| 692 }; | 692 }; |
| 693 | 693 |
| 694 } // namespace extensions | 694 } // namespace extensions |
| 695 | 695 |
| 696 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ | 696 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
| OLD | NEW |