| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_ | 5 #ifndef EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_ |
| 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_ | 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 | 12 |
| 13 class ExtensionIconSet; | 13 class ExtensionIconSet; |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class DictionaryValue; | 16 class DictionaryValue; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace extensions { | 19 namespace extensions { |
| 20 namespace manifest_handler_helpers { | 20 namespace manifest_handler_helpers { |
| 21 | 21 |
| 22 // Strips leading slashes from the file path. Returns true iff the final path is | 22 // Strips leading slashes from the file path. Returns true iff the final path is |
| 23 // non empty. | 23 // non empty. |
| 24 bool NormalizeAndValidatePath(std::string* path); | 24 bool NormalizeAndValidatePath(std::string* path); |
| 25 | 25 |
| 26 // Loads icon paths defined in dictionary |icons_value| into ExtensionIconSet | 26 // Loads icon paths defined in dictionary |icons_value| into ExtensionIconSet |
| 27 // |icons|. |icons_value| is a dictionary value {icon size -> icon path}. | 27 // |icons|. |icons_value| is a dictionary value {icon size -> icon path}. |
| 28 // Returns success. If load fails, |error| will be set. | 28 // Returns success. If load fails, |error| will be set. |
| 29 bool LoadIconsFromDictionary(const base::DictionaryValue* icons_value, | 29 bool LoadIconsFromDictionary(const base::DictionaryValue* icons_value, |
| 30 ExtensionIconSet* icons, | 30 ExtensionIconSet* icons, |
| 31 base::string16* error); | 31 base::string16* error); |
| 32 | 32 |
| 33 } // namespace manifest_handler_helpers | 33 } // namespace manifest_handler_helpers |
| 34 } // namespace extensions | 34 } // namespace extensions |
| 35 | 35 |
| 36 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_ | 36 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_ |
| OLD | NEW |