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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 Extension::Type type() const { return type_; } | 45 Extension::Type type() const { return type_; } |
46 | 46 |
47 bool is_theme() const { return type_ == Extension::TYPE_THEME; } | 47 bool is_theme() const { return type_ == Extension::TYPE_THEME; } |
48 bool is_platform_app() const { return type_ == Extension::TYPE_PLATFORM_APP; } | 48 bool is_platform_app() const { return type_ == Extension::TYPE_PLATFORM_APP; } |
49 bool is_packaged_app() const { return type_ == Extension::TYPE_PACKAGED_APP; } | 49 bool is_packaged_app() const { return type_ == Extension::TYPE_PACKAGED_APP; } |
50 bool is_hosted_app() const { return type_ == Extension::TYPE_HOSTED_APP; } | 50 bool is_hosted_app() const { return type_ == Extension::TYPE_HOSTED_APP; } |
51 | 51 |
52 // These access the wrapped manifest value, returning false when the property | 52 // These access the wrapped manifest value, returning false when the property |
53 // does not exist or if the manifest type can't access it. | 53 // does not exist or if the manifest type can't access it. |
54 bool HasKey(const std::string& key) const; | 54 bool HasKey(const std::string& key) const; |
| 55 bool HasPath(const std::string& path) const; |
55 bool Get(const std::string& path, base::Value** out_value) const; | 56 bool Get(const std::string& path, base::Value** out_value) const; |
56 bool GetBoolean(const std::string& path, bool* out_value) const; | 57 bool GetBoolean(const std::string& path, bool* out_value) const; |
57 bool GetInteger(const std::string& path, int* out_value) const; | 58 bool GetInteger(const std::string& path, int* out_value) const; |
58 bool GetString(const std::string& path, std::string* out_value) const; | 59 bool GetString(const std::string& path, std::string* out_value) const; |
59 bool GetString(const std::string& path, string16* out_value) const; | 60 bool GetString(const std::string& path, string16* out_value) const; |
60 bool GetDictionary(const std::string& path, | 61 bool GetDictionary(const std::string& path, |
61 base::DictionaryValue** out_value) const; | 62 base::DictionaryValue** out_value) const; |
62 bool GetList(const std::string& path, base::ListValue** out_value) const; | 63 bool GetList(const std::string& path, base::ListValue** out_value) const; |
63 | 64 |
64 // Returns a new Manifest equal to this one, passing ownership to | 65 // Returns a new Manifest equal to this one, passing ownership to |
(...skipping 25 matching lines...) Expand all Loading... |
90 scoped_ptr<base::DictionaryValue> value_; | 91 scoped_ptr<base::DictionaryValue> value_; |
91 | 92 |
92 Extension::Type type_; | 93 Extension::Type type_; |
93 | 94 |
94 DISALLOW_COPY_AND_ASSIGN(Manifest); | 95 DISALLOW_COPY_AND_ASSIGN(Manifest); |
95 }; | 96 }; |
96 | 97 |
97 } // namespace extensions | 98 } // namespace extensions |
98 | 99 |
99 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_H_ | 100 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_H_ |
OLD | NEW |