OLD | NEW |
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('experimental.declarative', | 11 chromeHidden.registerCustomHook('experimental.declarative', |
14 function(bindingsAPI) { | 12 function(bindingsAPI) { |
15 var apiFunctions = bindingsAPI.apiFunctions; | 13 var apiFunctions = bindingsAPI.apiFunctions; |
16 var sendRequest = bindingsAPI.sendRequest; | 14 var sendRequest = bindingsAPI.sendRequest; |
17 var apiDefinitions = bindingsAPI.apiDefinitions; | 15 var apiDefinitions = bindingsAPI.apiDefinitions; |
18 var cachedEventOptions = {}; | 16 var cachedEventOptions = {}; |
19 | 17 |
20 function getEventOptions(qualifiedEventName) { | 18 function getEventOptions(qualifiedEventName) { |
21 if (cachedEventOptions[qualifiedEventName]) | 19 if (cachedEventOptions[qualifiedEventName]) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 71 } |
74 validateRules(rules, | 72 validateRules(rules, |
75 eventOptions.conditions, | 73 eventOptions.conditions, |
76 eventOptions.actions); | 74 eventOptions.actions); |
77 sendRequest(this.name, [eventName, rules, opt_callback], | 75 sendRequest(this.name, [eventName, rules, opt_callback], |
78 this.definition.parameters); | 76 this.definition.parameters); |
79 }); | 77 }); |
80 }); | 78 }); |
81 | 79 |
82 })(); | 80 })(); |
OLD | NEW |