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

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

Issue 10890002: Make V8ValueConverter.FromV8Value behave similarly to JSON.stringify (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no more function Created 8 years, 3 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 bindings for the contextMenus API. 5 // Custom bindings for the contextMenus API.
6 6
7 var contextMenus = requireNative('context_menus'); 7 var contextMenus = requireNative('context_menus');
8 var GetNextContextMenuId = contextMenus.GetNextContextMenuId; 8 var GetNextContextMenuId = contextMenus.GetNextContextMenuId;
9 var sendRequest = require('sendRequest').sendRequest; 9 var sendRequest = require('sendRequest').sendRequest;
10 10
(...skipping 30 matching lines...) Expand all
41 if (onclick) { 41 if (onclick) {
42 onclick.apply(null, arguments); 42 onclick.apply(null, arguments);
43 } 43 }
44 }); 44 });
45 }; 45 };
46 46
47 apiFunctions.setHandleRequest('create', function() { 47 apiFunctions.setHandleRequest('create', function() {
48 var args = arguments; 48 var args = arguments;
49 var id = GetNextContextMenuId(); 49 var id = GetNextContextMenuId();
50 args[0].generatedId = id; 50 args[0].generatedId = id;
51 sendRequest(this.name, 51 var optArgs = {
52 args, 52 customCallback: this.customCallback,
53 this.definition.parameters, 53 };
54 {customCallback: this.customCallback}); 54 sendRequest(this.name, args, this.definition.parameters, optArgs);
55 return chromeHidden.contextMenus.getIdFromCreateProperties(args[0]); 55 return chromeHidden.contextMenus.getIdFromCreateProperties(args[0]);
56 }); 56 });
57 57
58 apiFunctions.setCustomCallback('create', function(name, request, response) { 58 apiFunctions.setCustomCallback('create', function(name, request, response) {
59 if (chrome.runtime.lastError) { 59 if (chrome.runtime.lastError) {
60 return; 60 return;
61 } 61 }
62 62
63 var id = chromeHidden.contextMenus.getIdFromCreateProperties( 63 var id = chromeHidden.contextMenus.getIdFromCreateProperties(
64 request.args[0]); 64 request.args[0]);
(...skipping 26 matching lines...) Expand all
91 91
92 apiFunctions.setCustomCallback('removeAll', 92 apiFunctions.setCustomCallback('removeAll',
93 function(name, request, response) { 93 function(name, request, response) {
94 if (chrome.runtime.lastError) { 94 if (chrome.runtime.lastError) {
95 return; 95 return;
96 } 96 }
97 chromeHidden.contextMenus.generatedIdHandlers = {}; 97 chromeHidden.contextMenus.generatedIdHandlers = {};
98 chromeHidden.contextMenus.stringIdHandlers = {}; 98 chromeHidden.contextMenus.stringIdHandlers = {};
99 }); 99 });
100 }); 100 });
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/user_script_scheduler.cc ('k') | chrome/renderer/resources/extensions/schema_generated_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698