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

Side by Side Diff: chrome/renderer/resources/extensions/extension_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: Created 8 years, 10 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 extension API. 5 // Custom bindings for the extension API.
6 6
7 (function() { 7 var GetChromeHidden = natives.GetChromeHidden;
8 8 var GetExtensionViews = natives.GetExtensionViews;
9 native function GetChromeHidden();
10 native function GetExtensionViews();
11 9
12 // This should match chrome.windows.WINDOW_ID_NONE. 10 // This should match chrome.windows.WINDOW_ID_NONE.
13 // 11 //
14 // We can't use chrome.windows.WINDOW_ID_NONE directly because the 12 // We can't use chrome.windows.WINDOW_ID_NONE directly because the
15 // chrome.windows API won't exist unless this extension has permission for it; 13 // chrome.windows API won't exist unless this extension has permission for it;
16 // which may not be the case. 14 // which may not be the case.
17 var WINDOW_ID_NONE = -1; 15 var WINDOW_ID_NONE = -1;
18 16
19 GetChromeHidden().registerCustomHook('extension', function(bindingsAPI) { 17 GetChromeHidden().registerCustomHook('extension', function(bindingsAPI) {
20 // getTabContentses is retained for backwards compatibility. 18 // getTabContentses is retained for backwards compatibility.
(...skipping 21 matching lines...) Expand all
42 return GetExtensionViews(-1, "BACKGROUND")[0] || null; 40 return GetExtensionViews(-1, "BACKGROUND")[0] || null;
43 }); 41 });
44 42
45 apiFunctions.setHandleRequest("extension.getExtensionTabs", 43 apiFunctions.setHandleRequest("extension.getExtensionTabs",
46 function(windowId) { 44 function(windowId) {
47 if (typeof(windowId) == "undefined") 45 if (typeof(windowId) == "undefined")
48 windowId = WINDOW_ID_NONE; 46 windowId = WINDOW_ID_NONE;
49 return GetExtensionViews(windowId, "TAB"); 47 return GetExtensionViews(windowId, "TAB");
50 }); 48 });
51 }); 49 });
52
53 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698