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

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

Issue 9657026: Revert 125801 - Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 webRequest API. 5 // Custom bindings for the webRequest API.
6 6
7 var webRequestNatives = requireNative('web_request'); 7 (function() {
8 var GetUniqueSubEventName = webRequestNatives.GetUniqueSubEventName;
9 8
10 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 9 native function GetChromeHidden();
10 native function GetUniqueSubEventName(eventName);
11
12 var chromeHidden = GetChromeHidden();
11 13
12 // WebRequestEvent object. This is used for special webRequest events with 14 // WebRequestEvent object. This is used for special webRequest events with
13 // extra parameters. Each invocation of addListener creates a new named 15 // extra parameters. Each invocation of addListener creates a new named
14 // sub-event. That sub-event is associated with the extra parameters in the 16 // sub-event. That sub-event is associated with the extra parameters in the
15 // browser process, so that only it is dispatched when the main event occurs 17 // browser process, so that only it is dispatched when the main event occurs
16 // matching the extra parameters. 18 // matching the extra parameters.
17 // 19 //
18 // Example: 20 // Example:
19 // chrome.webRequest.onBeforeRequest.addListener( 21 // chrome.webRequest.onBeforeRequest.addListener(
20 // callback, {urls: 'http://*.google.com/*'}); 22 // callback, {urls: 'http://*.google.com/*'});
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 sendRequest(this.name, args, this.definition.parameters, 165 sendRequest(this.name, args, this.definition.parameters,
164 {forIOThread: true}); 166 {forIOThread: true});
165 }); 167 });
166 168
167 apiFunctions.setHandleRequest('handlerBehaviorChanged', function() { 169 apiFunctions.setHandleRequest('handlerBehaviorChanged', function() {
168 var args = Array.prototype.slice.call(arguments); 170 var args = Array.prototype.slice.call(arguments);
169 sendRequest(this.name, args, this.definition.parameters, 171 sendRequest(this.name, args, this.definition.parameters,
170 {forIOThread: true}); 172 {forIOThread: true});
171 }); 173 });
172 }); 174 });
175
176 })();
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/types_custom_bindings.js ('k') | chrome/renderer/resources/extensions/webstore.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698