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

Unified Diff: chrome/browser/extensions/extension_prefs.h

Issue 11415216: Make Blacklist::IsBlacklist asynchronous (it will need to be for safe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_prefs.h
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index 6adb0156cec8b96cd1721b315c662e1b5aa34534..43a900996ad9503cf69835650c5cf31ad69af262 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -175,6 +175,13 @@ class ExtensionPrefs : public ContentSettingsStore::Observer,
Extension::DisableReason disable_reason);
void ClearDisableReasons(const std::string& extension_id);
+ // Gets the set of extensions that have been blacklisted in prefs.
+ std::set<std::string> GetBlacklistedExtensions();
+
+ // Sets whether the extension with |id| is blacklisted.
+ void SetExtensionBlacklisted(const std::string& extension_id,
+ bool is_blacklisted);
+
// Returns the version string for the currently installed extension, or
// the empty string if not found.
std::string GetVersionString(const std::string& extension_id);
@@ -189,11 +196,11 @@ class ExtensionPrefs : public ContentSettingsStore::Observer,
// Returns base extensions install directory.
const FilePath& install_directory() const { return install_directory_; }
- // Updates the prefs based on the blacklist.
- void UpdateBlacklist(const std::set<std::string>& blacklist_set);
-
- // Returns whether the extension with |id| is blacklisted.
- // You probably don't want to call this method, see Blacklist::IsBlacklisted.
+ // Returns whether the extension with |id| has its blacklist bit set.
+ //
+ // WARNING: this only checks the extension's entry in prefs! There may be
+ // other reasons why an extension is blacklisted! You probably want to use
+ // Blacklist::IsBlacklisted rather than this method.
bool IsExtensionBlacklisted(const std::string& id) const;
// Based on extension id, checks prefs to see if it is orphaned.
@@ -495,7 +502,8 @@ class ExtensionPrefs : public ContentSettingsStore::Observer,
URLPatternSet GetAllowedInstallSites();
private:
- friend class ExtensionPrefsUninstallExtension; // Unit test.
+ friend class ExtensionPrefsBlacklistedExtensions; // Unit test.
+ friend class ExtensionPrefsUninstallExtension; // Unit test.
// See the Create methods.
ExtensionPrefs(PrefService* prefs,

Powered by Google App Engine
This is Rietveld 408576698