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 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLER_HELPERS_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLER_HELPERS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/string16.h" |
| 12 |
| 13 namespace base { |
| 14 class DictionaryValue; |
| 15 } |
| 16 |
| 17 class ExtensionIconSet; |
| 18 |
| 19 namespace extensions { |
| 20 |
| 21 struct ActionInfo; |
| 22 class Extension; |
| 23 |
| 24 namespace manifest_handler_helpers { |
| 25 |
| 26 // Strips leading slashes from the file path. Returns true iff the final path is |
| 27 // non empty. |
| 28 bool NormalizeAndValidatePath(std::string* path); |
| 29 |
| 30 // Loads icon paths defined in dictionary |icons_value| into ExtensionIconSet |
| 31 // |icons|. |icons_value| is a dictionary value {icon size -> icon path}. Icons |
| 32 // in |icons_value| whose size is not in |icon_sizes| will be ignored. |
| 33 // Returns success. If load fails, |error| will be set. |
| 34 bool LoadIconsFromDictionary(const base::DictionaryValue* icons_value, |
| 35 const int* icon_sizes, |
| 36 size_t num_icon_sizes, |
| 37 ExtensionIconSet* icons, |
| 38 string16* error); |
| 39 |
| 40 // TODO(rdevlin.cronin): Move this to a helper file in |
| 41 // chrome/common/extensions/api/extension_action/ when the Extension class stops |
| 42 // using it. |
| 43 scoped_ptr<ActionInfo> LoadActionInfo( |
| 44 const Extension* extension, |
| 45 const base::DictionaryValue* manifest_section, |
| 46 string16* error); |
| 47 |
| 48 } // namespace manifest_handler_helpers |
| 49 } // namespace extensions |
| 50 |
| 51 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLER_HELPERS_H_ |
OLD | NEW |