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

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

Issue 12517011: Added activity logging for ext APIs with custom bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified setHandleRequest to avoid double logging 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 binding for the contextMenus API.
6 6
7 var binding = require('binding').Binding.create('contextMenus'); 7 var binding = require('binding').Binding.create('contextMenus');
8 8
9 var contextMenus = requireNative('context_menus'); 9 var contextMenus = requireNative('context_menus');
10 var GetNextContextMenuId = contextMenus.GetNextContextMenuId; 10 var GetNextContextMenuId = contextMenus.GetNextContextMenuId;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 apiFunctions.setHandleRequest('create', function() { 49 apiFunctions.setHandleRequest('create', function() {
50 var args = arguments; 50 var args = arguments;
51 var id = GetNextContextMenuId(); 51 var id = GetNextContextMenuId();
52 args[0].generatedId = id; 52 args[0].generatedId = id;
53 var optArgs = { 53 var optArgs = {
54 customCallback: this.customCallback, 54 customCallback: this.customCallback,
55 }; 55 };
56 sendRequest(this.name, args, this.definition.parameters, optArgs); 56 sendRequest(this.name, args, this.definition.parameters, optArgs);
57 return chromeHidden.contextMenus.getIdFromCreateProperties(args[0]); 57 return chromeHidden.contextMenus.getIdFromCreateProperties(args[0]);
58 }); 58 }, true);
59 59
60 apiFunctions.setCustomCallback('create', function(name, request, response) { 60 apiFunctions.setCustomCallback('create', function(name, request, response) {
61 if (chrome.runtime.lastError) { 61 if (chrome.runtime.lastError) {
62 return; 62 return;
63 } 63 }
64 64
65 var id = chromeHidden.contextMenus.getIdFromCreateProperties( 65 var id = chromeHidden.contextMenus.getIdFromCreateProperties(
66 request.args[0]); 66 request.args[0]);
67 67
68 // Set up the onclick handler if we were passed one in the request. 68 // Set up the onclick handler if we were passed one in the request.
(...skipping 26 matching lines...) Expand all
95 function(name, request, response) { 95 function(name, request, response) {
96 if (chrome.runtime.lastError) { 96 if (chrome.runtime.lastError) {
97 return; 97 return;
98 } 98 }
99 chromeHidden.contextMenus.generatedIdHandlers = {}; 99 chromeHidden.contextMenus.generatedIdHandlers = {};
100 chromeHidden.contextMenus.stringIdHandlers = {}; 100 chromeHidden.contextMenus.stringIdHandlers = {};
101 }); 101 });
102 }); 102 });
103 103
104 exports.binding = binding.generate(); 104 exports.binding = binding.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698