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

Side by Side Diff: chrome/renderer/resources/extensions/experimental.runtime_custom_bindings.js

Issue 10310182: Hack to restrict runtime API to dev channel rather than experimental. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: docs 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
(Empty)
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
3 // found in the LICENSE file.
4
5 // Custom bindings for the runtime API.
6
7 var extensionNatives = requireNative('extension');
8 var GetExtensionViews = extensionNatives.GetExtensionViews;
9 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
10 var sendRequest = require('sendRequest').sendRequest;
11
12 chromeHidden.registerCustomHook('experimental.runtime', function(bindingsAPI) {
13 var apiFunctions = bindingsAPI.apiFunctions;
14
15 apiFunctions.setCustomCallback('getBackgroundPage',
16 function(name, request, response) {
17 if (request.callback) {
18 var bg = GetExtensionViews(-1, 'BACKGROUND')[0] || null;
19 request.callback(bg);
20 }
21 request.callback = null;
22 });
23 });
OLDNEW
« no previous file with comments | « chrome/renderer/renderer_resources.grd ('k') | chrome/renderer/resources/extensions/runtime_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698