summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-14 02:05:21 +0000
committerskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-14 02:05:21 +0000
commit2c14985a6ed2c9c5866449715e506aefd14c523d (patch)
tree7249ea44d54487022220e79dda56d7c14ce5321a /chrome/renderer
parent575248557a13f1e03ce1bb65cbc2c2f13f5036b6 (diff)
downloadchromium_src-2c14985a6ed2c9c5866449715e506aefd14c523d.zip
chromium_src-2c14985a6ed2c9c5866449715e506aefd14c523d.tar.gz
chromium_src-2c14985a6ed2c9c5866449715e506aefd14c523d.tar.bz2
Fix error message when a page action calls chrome.pageAction.setIcon() with a nonexistent icon.
BUG=NONE TEST=Install chrome/common/extensions/docs/examples/api/pageAction/set_icon/, click the page action three times, look at the console. Review URL: http://codereview.chromium.org/536035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/resources/extension_process_bindings.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/renderer/resources/extension_process_bindings.js b/chrome/renderer/resources/extension_process_bindings.js
index 4558eb9..9d207f1 100644
--- a/chrome/renderer/resources/extension_process_bindings.js
+++ b/chrome/renderer/resources/extension_process_bindings.js
@@ -473,7 +473,7 @@ var chrome = chrome || {};
}
var canvas;
- function setIconCommon(details, name, parameters) {
+ function setIconCommon(details, name, parameters, actionType) {
var EXTENSION_ACTION_ICON_SIZE = 19;
if ("iconIndex" in details) {
@@ -503,8 +503,8 @@ var chrome = chrome || {};
} else if ("path" in details) {
var img = new Image();
img.onerror = function() {
- console.error("Could not load browser action icon '" + details.path +
- "'.");
+ console.error("Could not load " + actionType + " icon '" +
+ details.path + "'.");
}
img.onload = function() {
var canvas = document.createElement("canvas");
@@ -529,11 +529,13 @@ var chrome = chrome || {};
}
apiFunctions["browserAction.setIcon"].handleRequest = function(details) {
- setIconCommon(details, this.name, this.definition.parameters);
+ setIconCommon(
+ details, this.name, this.definition.parameters, "browser action");
};
apiFunctions["pageAction.setIcon"].handleRequest = function(details) {
- setIconCommon(details, this.name, this.definition.parameters);
+ setIconCommon(
+ details, this.name, this.definition.parameters, "page action");
};
if (chrome.test) {