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

Side by Side Diff: chrome/renderer/resources/extensions/experimental.declarative_custom_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: re-jigged to use ModuleSystem 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
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 declarative API. 5 // Custom bindings for the declarative API.
6 6
7 (function() { 7 (function() {
8 8
9 native function GetChromeHidden(); 9 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
10
11 var chromeHidden = GetChromeHidden();
12 10
13 chromeHidden.registerCustomHook( 11 chromeHidden.registerCustomHook(
14 'experimental.declarative', 12 'experimental.declarative',
15 function(bindingsAPI) { 13 function(bindingsAPI) {
16 var apiFunctions = bindingsAPI.apiFunctions; 14 var apiFunctions = bindingsAPI.apiFunctions;
17 var sendRequest = bindingsAPI.sendRequest; 15 var sendRequest = bindingsAPI.sendRequest;
18 var apiDefinitions = bindingsAPI.apiDefinitions; 16 var apiDefinitions = bindingsAPI.apiDefinitions;
19 var cachedEventOptions = {}; 17 var cachedEventOptions = {};
20 18
21 function getEventOptions(qualifiedEventName) { 19 function getEventOptions(qualifiedEventName) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 72 }
75 validateRules(rules, 73 validateRules(rules,
76 eventOptions.conditions, 74 eventOptions.conditions,
77 eventOptions.actions); 75 eventOptions.actions);
78 sendRequest(this.name, [eventName, rules, opt_callback], 76 sendRequest(this.name, [eventName, rules, opt_callback],
79 this.definition.parameters); 77 this.definition.parameters);
80 }); 78 });
81 }); 79 });
82 80
83 })(); 81 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698