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

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

Issue 9192029: Bindings layer for declarative events API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Continued Created 8 years, 11 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 // 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 var chrome = chrome || {}; 8 var chrome = chrome || {};
9 (function() { 9 (function() {
10 native function GetChromeHidden(); 10 native function GetChromeHidden();
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 448
449 // Setup Events 449 // Setup Events
450 if (apiDef.events) { 450 if (apiDef.events) {
451 apiDef.events.forEach(function(eventDef) { 451 apiDef.events.forEach(function(eventDef) {
452 if (eventDef.name in module || 452 if (eventDef.name in module ||
453 addUnprivilegedAccessGetter(module, eventDef.name, 453 addUnprivilegedAccessGetter(module, eventDef.name,
454 eventDef.unprivileged)) { 454 eventDef.unprivileged)) {
455 return; 455 return;
456 } 456 }
457 457
458 var typesAPI = {
459 'sendRequest': sendRequest,
460 'apiDefinitions': apiDefinitions
461 };
Matt Perry 2012/01/24 22:39:10 If we need to expose these identifiers to other mo
battre 2012/01/25 19:25:08 That would be a bigger change because the same mec
Matt Perry 2012/01/25 22:29:35 I don't understand. sendRequest and apiDefinitions
Aaron Boodman 2012/01/31 00:11:17 I kinda preferred it the way Dominic had it. Ben a
battre 2012/01/31 12:28:50 Ok, I will wait for Ben's and James' call.
458 var eventName = apiDef.namespace + "." + eventDef.name; 462 var eventName = apiDef.namespace + "." + eventDef.name;
459 var customEvent = customEvents[apiDef.namespace]; 463 var customEvent = customEvents[apiDef.namespace];
460 if (customEvent) { 464 if (customEvent) {
461 module[eventDef.name] = new customEvent( 465 module[eventDef.name] = new customEvent(
462 eventName, eventDef.parameters, eventDef.extraParameters); 466 eventName, eventDef.parameters, eventDef.extraParameters,
467 eventDef.options, typesAPI);
463 } else { 468 } else {
464 module[eventDef.name] = new chrome.Event( 469 module[eventDef.name] = new chrome.Event(
465 eventName, eventDef.parameters); 470 eventName, eventDef.parameters, eventDef.options, typesAPI);
466 } 471 }
467 }); 472 });
468 } 473 }
469 474
470 function addProperties(m, def) { 475 function addProperties(m, def) {
471 // Parse any values defined for properties. 476 // Parse any values defined for properties.
472 if (def.properties) { 477 if (def.properties) {
473 forEach(def.properties, function(prop, property) { 478 forEach(def.properties, function(prop, property) {
474 if (prop in m || 479 if (prop in m ||
475 addUnprivilegedAccessGetter(m, prop, property.unprivileged)) { 480 addUnprivilegedAccessGetter(m, prop, property.unprivileged)) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 // See http://crbug.com/100242 551 // See http://crbug.com/100242
547 if (apiExists("webstorePrivate")) { 552 if (apiExists("webstorePrivate")) {
548 chrome.webstorePrivate.beginInstallWithManifest2 = 553 chrome.webstorePrivate.beginInstallWithManifest2 =
549 chrome.webstorePrivate.beginInstallWithManifest3; 554 chrome.webstorePrivate.beginInstallWithManifest3;
550 } 555 }
551 556
552 if (apiExists("test")) 557 if (apiExists("test"))
553 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; 558 chrome.test.getApiDefinitions = GetExtensionAPIDefinition;
554 }); 559 });
555 })(); 560 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698