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

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

Issue 2693373003: PreloadCheck class for extension pre-install checks (Closed)
Patch Set: review ready Created 3 years, 9 months 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/blacklist_check.h
diff --git a/chrome/browser/extensions/blacklist_check.h b/chrome/browser/extensions/blacklist_check.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c36dd6c53fa5db56c6588d6b72494fc7881b359
--- /dev/null
+++ b/chrome/browser/extensions/blacklist_check.h
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_BLACKLIST_CHECK_H_
+#define CHROME_BROWSER_EXTENSIONS_BLACKLIST_CHECK_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "extensions/browser/blacklist_state.h"
+#include "extensions/browser/preload_check.h"
+
+namespace extensions {
+
+class Blacklist;
+class Extension;
+
+// Asynchronously checks whether the extension is blacklisted.
+class BlacklistCheck : public PreloadCheck {
+ public:
+ BlacklistCheck(Blacklist* blacklist, const Extension* extension);
+ ~BlacklistCheck() override;
+
+ // PreloadCheck:
+ void Start(ResultCallback callback) override;
+
+ private:
+ void OnGetIsBlacklisted(BlacklistState blacklist_state);
+
+ Blacklist* blacklist_;
+ ResultCallback callback_;
+ base::WeakPtrFactory<BlacklistCheck> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlacklistCheck);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_CHECK_H_

Powered by Google App Engine
This is Rietveld 408576698