page_action_custom_bindings.js revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2012 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5// Custom bindings for the pageAction API. 6 7var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 8var setIcon = require('setIcon').setIcon; 9 10chromeHidden.registerCustomHook('pageAction', function(bindingsAPI) { 11 var apiFunctions = bindingsAPI.apiFunctions; 12 13 apiFunctions.setHandleRequest('setIcon', function(details, callback) { 14 setIcon(details, callback, this.name, this.definition.parameters, 15 'page action'); 16 }); 17}); 18