OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 // GENERATED FROM THE API DEFINITION IN |
| 6 // chrome/common/extensions/api/permissions.json |
| 7 // DO NOT EDIT. |
| 8 |
| 9 #ifndef CHROME_COMMON_EXTENSIONS_API_PERMISSIONS_H__ |
| 10 #define CHROME_COMMON_EXTENSIONS_API_PERMISSIONS_H__ |
| 11 #pragma once |
| 12 |
| 13 #include <string> |
| 14 #include <vector> |
| 15 |
| 16 #include "base/basictypes.h" |
| 17 #include "base/memory/linked_ptr.h" |
| 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/values.h" |
| 20 |
| 21 using base::Value; |
| 22 using base::DictionaryValue; |
| 23 using base::ListValue; |
| 24 |
| 25 namespace extensions { |
| 26 namespace api { |
| 27 namespace permissions { |
| 28 |
| 29 // |
| 30 // Types |
| 31 // |
| 32 |
| 33 struct Permissions { |
| 34 ~Permissions(); |
| 35 Permissions(); |
| 36 |
| 37 // List of origin permissions. |
| 38 scoped_ptr<std::vector<std::string> > origins; |
| 39 |
| 40 // List of named permissions (does not include hosts or origins). |
| 41 scoped_ptr<std::vector<std::string> > permissions; |
| 42 |
| 43 // Populates a Permissions object from a Value. Returns whether |out| was |
| 44 // successfully populated. |
| 45 static bool Populate(const Value& value, Permissions* out); |
| 46 |
| 47 // Returns a new DictionaryValue representing the serialized form of this |
| 48 // Permissions object. Passesownership to caller. |
| 49 DictionaryValue* ToValue() const; |
| 50 |
| 51 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(Permissions); |
| 53 }; |
| 54 |
| 55 // |
| 56 // Functions |
| 57 // |
| 58 |
| 59 namespace Contains { |
| 60 struct Params { |
| 61 Permissions permissions; |
| 62 |
| 63 ~Params(); |
| 64 |
| 65 static scoped_ptr<Params> Create(const ListValue& args); |
| 66 |
| 67 private: |
| 68 Params(); |
| 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(Params); |
| 71 }; |
| 72 |
| 73 class Result { |
| 74 public: |
| 75 // True if the extension has the specified permissions. |
| 76 static Value* Create(const bool result); |
| 77 |
| 78 private: |
| 79 Result() {}; |
| 80 DISALLOW_COPY_AND_ASSIGN(Result); |
| 81 }; |
| 82 |
| 83 }; |
| 84 |
| 85 namespace GetAll { |
| 86 |
| 87 class Result { |
| 88 public: |
| 89 // The extension's active permissions. |
| 90 static Value* Create(const Permissions& permissions); |
| 91 |
| 92 private: |
| 93 Result() {}; |
| 94 DISALLOW_COPY_AND_ASSIGN(Result); |
| 95 }; |
| 96 |
| 97 }; |
| 98 |
| 99 namespace Request { |
| 100 struct Params { |
| 101 Permissions permissions; |
| 102 |
| 103 ~Params(); |
| 104 |
| 105 static scoped_ptr<Params> Create(const ListValue& args); |
| 106 |
| 107 private: |
| 108 Params(); |
| 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(Params); |
| 111 }; |
| 112 |
| 113 class Result { |
| 114 public: |
| 115 // True if the user granted the specified permissions. |
| 116 static Value* Create(const bool granted); |
| 117 |
| 118 private: |
| 119 Result() {}; |
| 120 DISALLOW_COPY_AND_ASSIGN(Result); |
| 121 }; |
| 122 |
| 123 }; |
| 124 |
| 125 namespace Remove { |
| 126 struct Params { |
| 127 Permissions permissions; |
| 128 |
| 129 ~Params(); |
| 130 |
| 131 static scoped_ptr<Params> Create(const ListValue& args); |
| 132 |
| 133 private: |
| 134 Params(); |
| 135 |
| 136 DISALLOW_COPY_AND_ASSIGN(Params); |
| 137 }; |
| 138 |
| 139 class Result { |
| 140 public: |
| 141 // True if the permissions were removed. |
| 142 static Value* Create(const bool removed); |
| 143 |
| 144 private: |
| 145 Result() {}; |
| 146 DISALLOW_COPY_AND_ASSIGN(Result); |
| 147 }; |
| 148 |
| 149 }; |
| 150 |
| 151 |
| 152 } // permissions |
| 153 } // api |
| 154 } // extensions |
| 155 |
| 156 #endif // CHROME_COMMON_EXTENSIONS_API_PERMISSIONS_H__ |
OLD | NEW |