summaryrefslogtreecommitdiffstats
path: root/extensions/browser/requirements_checker.h
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2015-02-24 12:21:10 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-24 20:21:38 +0000
commit69bf75316e7ae533c0a0dccc1a56ca019aa95a1e (patch)
tree19c73070991a2965d12a784760136c3247be45b6 /extensions/browser/requirements_checker.h
parent1d7ceee2bfb36e0a21e2d224a3bd13c447d293d7 (diff)
downloadchromium_src-69bf75316e7ae533c0a0dccc1a56ca019aa95a1e.zip
chromium_src-69bf75316e7ae533c0a0dccc1a56ca019aa95a1e.tar.gz
chromium_src-69bf75316e7ae533c0a0dccc1a56ca019aa95a1e.tar.bz2
[Extensions] Start making chrome://extensions use extensions APIs
Allow chrome://extensions to use the developerPrivate and management apis, and make it do so for enabling/disabling extensions. Also, shave yaks: - Make management api check requirements for extensions. - Make feature provider aware of complex parents. And bonus: - Remove WeakPtr interface from RequirementsChecker BUG=461039 Review URL: https://codereview.chromium.org/951633002 Cr-Commit-Position: refs/heads/master@{#317871}
Diffstat (limited to 'extensions/browser/requirements_checker.h')
-rw-r--r--extensions/browser/requirements_checker.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/extensions/browser/requirements_checker.h b/extensions/browser/requirements_checker.h
new file mode 100644
index 0000000..a5c1614
--- /dev/null
+++ b/extensions/browser/requirements_checker.h
@@ -0,0 +1,38 @@
+// Copyright 2015 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_REQUIREMENTS_CHECKER_H_
+#define CHROME_BROWSER_EXTENSIONS_REQUIREMENTS_CHECKER_H_
+
+#include <vector>
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+
+namespace extensions {
+class Extension;
+
+// Validates the 'requirements' extension manifest field. This is an
+// asynchronous process that involves several threads, but the public interface
+// of this class (including constructor and destructor) must only be used on
+// the UI thread.
+class RequirementsChecker {
+ public:
+ virtual ~RequirementsChecker() {}
+
+ using RequirementsCheckedCallback =
+ base::Callback<void(const std::vector<std::string>& /* requirements */)>;
+
+ // The vector passed to the callback are any localized errors describing
+ // requirement violations. If this vector is non-empty, requirements checking
+ // failed. This should only be called once. |callback| will always be invoked
+ // asynchronously on the UI thread. |callback| will only be called once, and
+ // will be reset after called.
+ virtual void Check(const scoped_refptr<const Extension>& extension,
+ const RequirementsCheckedCallback& callback) = 0;
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_REQUIREMENTS_CHECKER_H_