OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_H_ |
6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_H_ | 6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <set> | 10 #include <set> |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 bool is_hosted_app() const { return type_ == TYPE_HOSTED_APP; } | 110 bool is_hosted_app() const { return type_ == TYPE_HOSTED_APP; } |
111 bool is_legacy_packaged_app() const { | 111 bool is_legacy_packaged_app() const { |
112 return type_ == TYPE_LEGACY_PACKAGED_APP; | 112 return type_ == TYPE_LEGACY_PACKAGED_APP; |
113 } | 113 } |
114 bool is_extension() const { return type_ == TYPE_EXTENSION; } | 114 bool is_extension() const { return type_ == TYPE_EXTENSION; } |
115 | 115 |
116 // These access the wrapped manifest value, returning false when the property | 116 // These access the wrapped manifest value, returning false when the property |
117 // does not exist or if the manifest type can't access it. | 117 // does not exist or if the manifest type can't access it. |
118 bool HasKey(const std::string& key) const; | 118 bool HasKey(const std::string& key) const; |
119 bool HasPath(const std::string& path) const; | 119 bool HasPath(const std::string& path) const; |
120 bool Get(const std::string& path, base::Value** out_value) const; | 120 bool Get(const std::string& path, const base::Value** out_value) const; |
121 bool GetBoolean(const std::string& path, bool* out_value) const; | 121 bool GetBoolean(const std::string& path, bool* out_value) const; |
122 bool GetInteger(const std::string& path, int* out_value) const; | 122 bool GetInteger(const std::string& path, int* out_value) const; |
123 bool GetString(const std::string& path, std::string* out_value) const; | 123 bool GetString(const std::string& path, std::string* out_value) const; |
124 bool GetString(const std::string& path, string16* out_value) const; | 124 bool GetString(const std::string& path, string16* out_value) const; |
125 bool GetDictionary(const std::string& path, | 125 bool GetDictionary(const std::string& path, |
126 const base::DictionaryValue** out_value) const; | 126 const base::DictionaryValue** out_value) const; |
127 bool GetDictionary(const std::string& path, | |
128 base::DictionaryValue** out_value) const; | |
129 bool GetList(const std::string& path, | 127 bool GetList(const std::string& path, |
130 const base::ListValue** out_value) const; | 128 const base::ListValue** out_value) const; |
131 bool GetList(const std::string& path, base::ListValue** out_value) const; | |
132 | 129 |
133 // Returns a new Manifest equal to this one, passing ownership to | 130 // Returns a new Manifest equal to this one, passing ownership to |
134 // the caller. | 131 // the caller. |
135 Manifest* DeepCopy() const; | 132 Manifest* DeepCopy() const; |
136 | 133 |
137 // Returns true if this equals the |other| manifest. | 134 // Returns true if this equals the |other| manifest. |
138 bool Equals(const Manifest* other) const; | 135 bool Equals(const Manifest* other) const; |
139 | 136 |
140 // Gets the underlying DictionaryValue representing the manifest. | 137 // Gets the underlying DictionaryValue representing the manifest. |
141 // Note: only use this when you KNOW you don't need the validation. | 138 // Note: only use this when you KNOW you don't need the validation. |
(...skipping 17 matching lines...) Expand all Loading... |
159 scoped_ptr<base::DictionaryValue> value_; | 156 scoped_ptr<base::DictionaryValue> value_; |
160 | 157 |
161 Type type_; | 158 Type type_; |
162 | 159 |
163 DISALLOW_COPY_AND_ASSIGN(Manifest); | 160 DISALLOW_COPY_AND_ASSIGN(Manifest); |
164 }; | 161 }; |
165 | 162 |
166 } // namespace extensions | 163 } // namespace extensions |
167 | 164 |
168 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_H_ | 165 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_H_ |
OLD | NEW |