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

Unified Diff: chrome/browser/extensions/blacklist.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: fix another test Created 8 years 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
« no previous file with comments | « chrome/browser/extensions/admin_policy_unittest.cc ('k') | chrome/browser/extensions/blacklist.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/blacklist.h
diff --git a/chrome/browser/extensions/blacklist.h b/chrome/browser/extensions/blacklist.h
index 58b12dbab31fdf098a4e48d76b81e9f40ef6a079..89705a5e7ea4822407590df53fc689541bf17c44 100644
--- a/chrome/browser/extensions/blacklist.h
+++ b/chrome/browser/extensions/blacklist.h
@@ -5,9 +5,11 @@
#ifndef CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_
#define CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_
+#include <set>
#include <string>
#include <vector>
+#include "base/callback.h"
#include "base/observer_list.h"
namespace extensions {
@@ -32,18 +34,19 @@ class Blacklist {
Blacklist* blacklist_;
};
+ typedef base::Callback<void(const std::set<std::string>&)>
+ GetBlacklistedIDsCallback;
+
// |prefs_| must outlive this.
explicit Blacklist(ExtensionPrefs* prefs);
~Blacklist();
- // Gets whether an extension is blacklisted.
- //
- // Note that this doesn't entirely determine whether an extension is allowed
- // to be loaded; there are other considerations (e.g. admin settings).
- // See extensions::ManagementPolicy (in particular UserMayLoad).
- bool IsBlacklisted(const std::string& extension_id) const;
- bool IsBlacklisted(const Extension* extension) const;
+ // From the set of extension IDs passed in via |ids|, asynchronously checks
+ // which are blacklisted and includes them in the resulting set passed
+ // via |callback|, which will be sent on the caller's message loop.
+ void GetBlacklistedIDs(const std::set<std::string>& ids,
+ const GetBlacklistedIDsCallback& callback);
// Sets the blacklist from the updater to contain the extension IDs in |ids|
void SetFromUpdater(const std::vector<std::string>& ids,
@@ -58,6 +61,8 @@ class Blacklist {
ExtensionPrefs* const prefs_;
+ std::set<std::string> prefs_blacklist_;
+
DISALLOW_COPY_AND_ASSIGN(Blacklist);
};
« no previous file with comments | « chrome/browser/extensions/admin_policy_unittest.cc ('k') | chrome/browser/extensions/blacklist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698