diff options
author | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-08 18:48:52 +0000 |
---|---|---|
committer | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-08 18:48:52 +0000 |
commit | aadde5988b5b71abcf99d1c4d8fa77290165b801 (patch) | |
tree | a73e811c055e968eaf712efad26234ae51a9108c /extensions/common/manifest_handler_helpers.h | |
parent | 3bd9be0e7330b753699e200e31f48342a591c68c (diff) | |
download | chromium_src-aadde5988b5b71abcf99d1c4d8fa77290165b801.zip chromium_src-aadde5988b5b71abcf99d1c4d8fa77290165b801.tar.gz chromium_src-aadde5988b5b71abcf99d1c4d8fa77290165b801.tar.bz2 |
Move manifest_handler_helpers to //extensions
BUG=359836
Review URL: https://codereview.chromium.org/228603004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/manifest_handler_helpers.h')
-rw-r--r-- | extensions/common/manifest_handler_helpers.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/extensions/common/manifest_handler_helpers.h b/extensions/common/manifest_handler_helpers.h new file mode 100644 index 0000000..01fe6cc --- /dev/null +++ b/extensions/common/manifest_handler_helpers.h @@ -0,0 +1,39 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_ +#define EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_ + +#include <string> + +#include "base/memory/scoped_ptr.h" +#include "base/strings/string16.h" + +class ExtensionIconSet; + +namespace base { +class DictionaryValue; +} + +namespace extensions { +namespace manifest_handler_helpers { + +// Strips leading slashes from the file path. Returns true iff the final path is +// non empty. +bool NormalizeAndValidatePath(std::string* path); + +// Loads icon paths defined in dictionary |icons_value| into ExtensionIconSet +// |icons|. |icons_value| is a dictionary value {icon size -> icon path}. Icons +// in |icons_value| whose size is not in |icon_sizes| will be ignored. +// Returns success. If load fails, |error| will be set. +bool LoadIconsFromDictionary(const base::DictionaryValue* icons_value, + const int* icon_sizes, + size_t num_icon_sizes, + ExtensionIconSet* icons, + base::string16* error); + +} // namespace manifest_handler_helpers +} // namespace extensions + +#endif // EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_ |