summaryrefslogtreecommitdiffstats
path: root/extensions/common/manifest_handler_helpers.h
diff options
context:
space:
mode:
authorestade <estade@chromium.org>2015-12-18 18:39:37 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-19 02:40:36 +0000
commit6e8e7d1c49657e82d0e8f2518ad463794346321b (patch)
tree516b2ba9491ad1c0097dcb766b411bb82a809641 /extensions/common/manifest_handler_helpers.h
parentf45be477c7c9913086ac2ba256dfeafac6fcc45a (diff)
downloadchromium_src-6e8e7d1c49657e82d0e8f2518ad463794346321b.zip
chromium_src-6e8e7d1c49657e82d0e8f2518ad463794346321b.tar.gz
chromium_src-6e8e7d1c49657e82d0e8f2518ad463794346321b.tar.bz2
Change extension icon load errors to warnings
During the Extension parsing step, check if the icon file exists and if not, remove that entry from the dictionary. Keep the same check during the validation phase and don't apply the workaround to unpacked extensions. This will more strongly discourage new extensions from making this mistake. BUG=570249 Review URL: https://codereview.chromium.org/1537473003 Cr-Commit-Position: refs/heads/master@{#366253}
Diffstat (limited to 'extensions/common/manifest_handler_helpers.h')
-rw-r--r--extensions/common/manifest_handler_helpers.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/extensions/common/manifest_handler_helpers.h b/extensions/common/manifest_handler_helpers.h
index b0249c3..e1f901a 100644
--- a/extensions/common/manifest_handler_helpers.h
+++ b/extensions/common/manifest_handler_helpers.h
@@ -6,9 +6,11 @@
#define EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_
#include <string>
+#include <vector>
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
+#include "extensions/common/install_warning.h"
class ExtensionIconSet;
@@ -17,6 +19,9 @@ class DictionaryValue;
}
namespace extensions {
+
+class Extension;
+
namespace manifest_handler_helpers {
// Strips leading slashes from the file path. Returns true iff the final path is
@@ -25,8 +30,10 @@ 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,
+// Returns success. If load fails, |error| will be set. Non-failure warnings may
+// be added to |extension|.
+bool LoadIconsFromDictionary(Extension* extension,
+ const base::DictionaryValue* icons_value,
ExtensionIconSet* icons,
base::string16* error);