Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2970)

Unified Diff: chrome/renderer/resources/extensions/browser_action_custom_bindings.js

Issue 477193003: Refactor setIcon to allow for more general use of imageData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moar minor changes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/renderer/resources/extensions/page_action_custom_bindings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/browser_action_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/browser_action_custom_bindings.js b/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
index 60ac0c3b531e7cc50a12e583d6e464986f5a0c4f..57043051470003d0feac54977fcdca4e2f3143d1 100644
--- a/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
@@ -8,13 +8,15 @@ var binding = require('binding').Binding.create('browserAction');
var setIcon = require('setIcon').setIcon;
var getExtensionViews = requireNative('runtime').GetExtensionViews;
+var sendRequest = require('sendRequest').sendRequest;
binding.registerCustomHook(function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
apiFunctions.setHandleRequest('setIcon', function(details, callback) {
- setIcon(details, callback, this.name, this.definition.parameters,
- 'browser action');
+ setIcon(details, function(args) {
+ sendRequest(this.name, [args, callback], this.definition.parameters);
+ }.bind(this));
});
apiFunctions.setCustomCallback('openPopup',
« no previous file with comments | « no previous file | chrome/renderer/resources/extensions/page_action_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698