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

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

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile errors Created 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 // Set up the global chrome object.
6 chrome = {};
7
8 var contextInfo = requireNative('context_info');
9 var sgb = requireNative('schema_generated_bindings');
10
11 require('app');
Aaron Boodman 2012/03/01 07:24:26 Why do this in JavaScript? It seems to end up bein
koz (OOO until 15th September) 2012/03/02 01:13:58 I think it makes it easier to understand what's ha
12 require('webstore');
13
14 if (contextInfo.IsBindingsAllowed()) {
15 require('json_schema');
Aaron Boodman 2012/03/01 07:24:26 Have schema_generated_bindings just require this?
koz (OOO until 15th September) 2012/03/02 01:13:58 Done.
16 require('event_bindings');
Aaron Boodman 2012/03/01 07:24:26 Have miscellaneous_bindings and schema_generated_b
koz (OOO until 15th September) 2012/03/02 01:13:58 Done.
17 require('miscellaneous_bindings');
18 require('schema_generated_bindings');
19 require('apitest');
20
21 // Load the custom bindings for each API.
22 sgb.GetExtensionAPIDefinition().forEach(function(apiDef) {
Aaron Boodman 2012/03/01 07:24:26 I wonder if this could be part of SchemaGeneratedB
koz (OOO until 15th September) 2012/03/02 01:13:58 Yeah, it could be, but with this change I'd rather
23 if (contextInfo.IsAPIAllowed(apiDef.namespace))
24 require(apiDef.namespace);
25 });
26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698