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

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

Issue 10826295: Revert 151420 - Add documentation for filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/resources/extensions/event.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This script contains privileged chrome extension related javascript APIs. 5 // This script contains privileged chrome extension related javascript APIs.
6 // It is loaded by pages whose URL has the chrome-extension protocol. 6 // It is loaded by pages whose URL has the chrome-extension protocol.
7 7
8 // TODO(battre): cleanup the usage of packages everywhere, as described here 8 // TODO(battre): cleanup the usage of packages everywhere, as described here
9 // http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/e xtensions/schema_generated_bindings.js 9 // http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/e xtensions/schema_generated_bindings.js
10 10
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 335 }
336 if (!isSchemaNodeSupported(eventDef, platform, manifestVersion)) 336 if (!isSchemaNodeSupported(eventDef, platform, manifestVersion))
337 return; 337 return;
338 if (!isSchemaAccessAllowed(eventDef)) { 338 if (!isSchemaAccessAllowed(eventDef)) {
339 addUnprivilegedAccessGetter(mod, eventDef.name); 339 addUnprivilegedAccessGetter(mod, eventDef.name);
340 return; 340 return;
341 } 341 }
342 342
343 var eventName = apiDef.namespace + "." + eventDef.name; 343 var eventName = apiDef.namespace + "." + eventDef.name;
344 var customEvent = customEvents[apiDef.namespace]; 344 var customEvent = customEvents[apiDef.namespace];
345 var options = eventDef.options || {};
346
347 if (eventDef.filters && eventDef.filters.length > 0)
348 options.supportsFilters = true;
349
350 if (customEvent) { 345 if (customEvent) {
351 mod[eventDef.name] = new customEvent( 346 mod[eventDef.name] = new customEvent(
352 eventName, eventDef.parameters, eventDef.extraParameters, 347 eventName, eventDef.parameters, eventDef.extraParameters,
353 options); 348 eventDef.options);
354 } else if (eventDef.anonymous) { 349 } else if (eventDef.anonymous) {
355 mod[eventDef.name] = new chrome.Event(); 350 mod[eventDef.name] = new chrome.Event();
356 } else { 351 } else {
357 mod[eventDef.name] = new chrome.Event( 352 mod[eventDef.name] = new chrome.Event(
358 eventName, eventDef.parameters, options); 353 eventName, eventDef.parameters, eventDef.options);
359 } 354 }
360 }); 355 });
361 } 356 }
362 357
363 function addProperties(m, parentDef) { 358 function addProperties(m, parentDef) {
364 var properties = parentDef.properties; 359 var properties = parentDef.properties;
365 if (!properties) 360 if (!properties)
366 return; 361 return;
367 362
368 utils.forEach(properties, function(propertyName, propertyDef) { 363 utils.forEach(properties, function(propertyName, propertyDef) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 // beginInstallWithManifest2. 433 // beginInstallWithManifest2.
439 // See http://crbug.com/100242 434 // See http://crbug.com/100242
440 if (chrome.webstorePrivate) { 435 if (chrome.webstorePrivate) {
441 chrome.webstorePrivate.beginInstallWithManifest2 = 436 chrome.webstorePrivate.beginInstallWithManifest2 =
442 chrome.webstorePrivate.beginInstallWithManifest3; 437 chrome.webstorePrivate.beginInstallWithManifest3;
443 } 438 }
444 439
445 if (chrome.test) 440 if (chrome.test)
446 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; 441 chrome.test.getApiDefinitions = GetExtensionAPIDefinition;
447 }); 442 });
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/event.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698