summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_prefs.h
diff options
context:
space:
mode:
authorlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 06:37:18 +0000
committerlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 06:37:18 +0000
commit6b75ec3c19f7a05c9104ee4b1edf2074af88d5b9 (patch)
treec992c8e6606b6a7cf52e3e2427dd1a4d33c24e0a /chrome/browser/extensions/extension_prefs.h
parent7b291f9c1394495724ddd81306e982e840075c08 (diff)
downloadchromium_src-6b75ec3c19f7a05c9104ee4b1edf2074af88d5b9.zip
chromium_src-6b75ec3c19f7a05c9104ee4b1edf2074af88d5b9.tar.gz
chromium_src-6b75ec3c19f7a05c9104ee4b1edf2074af88d5b9.tar.bz2
The change has the followings:
1. Auto-updating of extension blacklist. 2. Handle extensions in the blacklist. If an extension is in the blacklist, a. browser will not load the extension at start time; b. browser will unload the extension at running time; c. browser will not install the extension; BUG=12118 TEST=Verify behavior described above works (they should be covered in the unittests in this change). Review URL: http://codereview.chromium.org/165164 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_prefs.h')
-rw-r--r--chrome/browser/extensions/extension_prefs.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index 277b9c3..c819bcd 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H
+#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_
#include <set>
#include <string>
@@ -46,6 +46,12 @@ class ExtensionPrefs {
// 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);
+
+ // Based on extension id, checks prefs to see if it is blacklisted.
+ bool IsExtensionBlacklisted(const std::string& id);
+
private:
// Converts absolute paths in the pref to paths relative to the
@@ -67,6 +73,11 @@ class ExtensionPrefs {
// Ensures and returns a mutable dictionary for extension |id|'s prefs.
DictionaryValue* GetOrCreateExtensionPref(const std::string& id);
+ // Checks if kPrefBlacklist is set to true in the DictionaryValue.
+ // Return false if the value is false or kPrefBlacklist does not exist.
+ // This is used to decide if an extension is blacklisted.
+ bool IsBlacklistBitSet(DictionaryValue* ext);
+
// The pref service specific to this set of extension prefs.
PrefService* prefs_;
@@ -91,7 +102,8 @@ class InstalledExtensions {
Extension::Location>::Type Callback;
// Runs |callback| for each installed extension with the path to the
- // version directory and the location.
+ // version directory and the location. Blacklisted extensions won't trigger
+ // the callback.
void VisitInstalledExtensions(Callback *callback);
private:
@@ -102,4 +114,5 @@ class InstalledExtensions {
DISALLOW_COPY_AND_ASSIGN(InstalledExtensions);
};
-#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_
+