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

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

Issue 10257006: Move Declarative Web Request API out of experimental and make it a feature (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 8 years, 7 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 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
8 var sendRequest = require('sendRequest').sendRequest; 8 var sendRequest = require('sendRequest').sendRequest;
9 9
10 chromeHidden.registerCustomHook('experimental.declarative', 10 chromeHidden.registerCustomHook('declarative',
11 function(bindingsAPI) { 11 function(bindingsAPI) {
12 var apiFunctions = bindingsAPI.apiFunctions; 12 var apiFunctions = bindingsAPI.apiFunctions;
13 var apiDefinitions = bindingsAPI.apiDefinitions; 13 var apiDefinitions = bindingsAPI.apiDefinitions;
14 var cachedEventOptions = {}; 14 var cachedEventOptions = {};
15 15
16 function getEventOptions(qualifiedEventName) { 16 function getEventOptions(qualifiedEventName) {
17 if (cachedEventOptions[qualifiedEventName]) 17 if (cachedEventOptions[qualifiedEventName])
18 return cachedEventOptions[qualifiedEventName]; 18 return cachedEventOptions[qualifiedEventName];
19 19
20 // Parse qualifiedEventName into namespace and event name. 20 // Parse qualifiedEventName into namespace and event name.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 throw new Error('Event ' + eventName + ' misses conditions or ' + 67 throw new Error('Event ' + eventName + ' misses conditions or ' +
68 'actions in the API specification.'); 68 'actions in the API specification.');
69 } 69 }
70 validateRules(rules, 70 validateRules(rules,
71 eventOptions.conditions, 71 eventOptions.conditions,
72 eventOptions.actions); 72 eventOptions.actions);
73 sendRequest(this.name, [eventName, rules, opt_callback], 73 sendRequest(this.name, [eventName, rules, opt_callback],
74 this.definition.parameters); 74 this.definition.parameters);
75 }); 75 });
76 }); 76 });
OLDNEW
« no previous file with comments | « chrome/renderer/renderer_resources.grd ('k') | chrome/renderer/resources/extensions/declarative_webrequest_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698