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( | 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 Loading... |
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 })(); |
OLD | NEW |