summaryrefslogtreecommitdiff
path: root/chromium/extensions/common/manifest_handler_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/extensions/common/manifest_handler_helpers.h')
-rw-r--r--chromium/extensions/common/manifest_handler_helpers.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/chromium/extensions/common/manifest_handler_helpers.h b/chromium/extensions/common/manifest_handler_helpers.h
new file mode 100644
index 00000000000..b0249c30c96
--- /dev/null
+++ b/chromium/extensions/common/manifest_handler_helpers.h
@@ -0,0 +1,36 @@
+// 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}.
+// Returns success. If load fails, |error| will be set.
+bool LoadIconsFromDictionary(const base::DictionaryValue* icons_value,
+ ExtensionIconSet* icons,
+ base::string16* error);
+
+} // namespace manifest_handler_helpers
+} // namespace extensions
+
+#endif // EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_