OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_CHROME_MANIFEST_PERMISSION_SET_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_CHROME_MANIFEST_PERMISSION_SET_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/strings/string16.h" |
| 12 |
| 13 namespace base { |
| 14 class ListValue; |
| 15 } |
| 16 |
| 17 namespace extensions { |
| 18 class ManifestPermissionSet; |
| 19 } |
| 20 |
| 21 namespace extensions { |
| 22 |
| 23 class ChromeManifestPermissionSet { |
| 24 public: |
| 25 // Parses permissions from |permissions| and adds the parsed permissions to |
| 26 // |manifest_permissions|. If |unhandled_permissions| is not NULL, the names |
| 27 // of all permissions that couldn't be parsed will be added to this vector. |
| 28 // If |error| is NULL, parsing will continue with the next permission if |
| 29 // invalid data is detected. If |error| is not NULL, it will be set to an |
| 30 // error message and false is returned when an invalid permission is found. |
| 31 static bool ParseFromJSON( |
| 32 const base::ListValue* permissions, |
| 33 ManifestPermissionSet* manifest_permissions, |
| 34 string16* error, |
| 35 std::vector<std::string>* unhandled_permissions); |
| 36 }; |
| 37 |
| 38 } // namespace extensions |
| 39 |
| 40 #endif // CHROME_COMMON_EXTENSIONS_CHROME_MANIFEST_PERMISSION_SET_H_ |
OLD | NEW |