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_ |