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

Side by Side Diff: chrome/renderer/resources/extensions/context_menus_custom_bindings.js

Issue 12313142: Revert 184837 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Custom binding for the contextMenus API. 5 // Custom bindings for the contextMenus API.
6
7 var binding = require('binding').Binding.create('contextMenus');
8 6
9 var contextMenus = requireNative('context_menus'); 7 var contextMenus = requireNative('context_menus');
10 var GetNextContextMenuId = contextMenus.GetNextContextMenuId; 8 var GetNextContextMenuId = contextMenus.GetNextContextMenuId;
11 var sendRequest = require('sendRequest').sendRequest; 9 var sendRequest = require('sendRequest').sendRequest;
12 10
13 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 11 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
14 12
15 binding.registerCustomHook(function(bindingsAPI) { 13 chromeHidden.registerCustomHook('contextMenus', function(bindingsAPI) {
16 var apiFunctions = bindingsAPI.apiFunctions; 14 var apiFunctions = bindingsAPI.apiFunctions;
17 15
18 chromeHidden.contextMenus = {}; 16 chromeHidden.contextMenus = {};
19 chromeHidden.contextMenus.generatedIdHandlers = {}; 17 chromeHidden.contextMenus.generatedIdHandlers = {};
20 chromeHidden.contextMenus.stringIdHandlers = {}; 18 chromeHidden.contextMenus.stringIdHandlers = {};
21 var eventName = 'contextMenus'; 19 var eventName = 'contextMenus';
22 chromeHidden.contextMenus.event = new chrome.Event(eventName); 20 chromeHidden.contextMenus.event = new chrome.Event(eventName);
23 chromeHidden.contextMenus.getIdFromCreateProperties = function(prop) { 21 chromeHidden.contextMenus.getIdFromCreateProperties = function(prop) {
24 if (typeof(prop.id) !== 'undefined') 22 if (typeof(prop.id) !== 'undefined')
25 return prop.id; 23 return prop.id;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 91
94 apiFunctions.setCustomCallback('removeAll', 92 apiFunctions.setCustomCallback('removeAll',
95 function(name, request, response) { 93 function(name, request, response) {
96 if (chrome.runtime.lastError) { 94 if (chrome.runtime.lastError) {
97 return; 95 return;
98 } 96 }
99 chromeHidden.contextMenus.generatedIdHandlers = {}; 97 chromeHidden.contextMenus.generatedIdHandlers = {};
100 chromeHidden.contextMenus.stringIdHandlers = {}; 98 chromeHidden.contextMenus.stringIdHandlers = {};
101 }); 99 });
102 }); 100 });
103
104 exports.binding = binding.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698