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

Unified Diff: chrome/common/extensions/chrome_manifest_permission_set.h

Issue 51433002: Enable permission warnings from ManifestHandlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing. Created 7 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/common/extensions/chrome_manifest_permission_set.h
diff --git a/chrome/common/extensions/chrome_manifest_permission_set.h b/chrome/common/extensions/chrome_manifest_permission_set.h
new file mode 100644
index 0000000000000000000000000000000000000000..8e942674c7a38599e9d37d3f8d372b060b5c4b48
--- /dev/null
+++ b/chrome/common/extensions/chrome_manifest_permission_set.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2013 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_COMMON_EXTENSIONS_CHROME_MANIFEST_PERMISSION_SET_H_
+#define CHROME_COMMON_EXTENSIONS_CHROME_MANIFEST_PERMISSION_SET_H_
+
+#include <string>
+#include <vector>
+
+#include "base/strings/string16.h"
+
+namespace base {
+class ListValue;
+}
+
+namespace extensions {
+class ManifestPermissionSet;
+}
+
+namespace extensions {
+
+class ChromeManifestPermissionSet {
+ public:
+ // Parses permissions from |permissions| and adds the parsed permissions to
+ // |manifest_permissions|. If |unhandled_permissions| is not NULL, the names
+ // of all permissions that couldn't be parsed will be added to this vector.
+ // If |error| is NULL, parsing will continue with the next permission if
+ // invalid data is detected. If |error| is not NULL, it will be set to an
+ // error message and false is returned when an invalid permission is found.
+ static bool ParseFromJSON(
+ const base::ListValue* permissions,
+ ManifestPermissionSet* manifest_permissions,
+ string16* error,
+ std::vector<std::string>* unhandled_permissions);
+};
+
+} // namespace extensions
+
+#endif // CHROME_COMMON_EXTENSIONS_CHROME_MANIFEST_PERMISSION_SET_H_

Powered by Google App Engine
This is Rietveld 408576698