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

Side by Side Diff: chrome/browser/resources/plugins.js

Issue 2590393002: Revert of Mojo JS bindings: switch most usage of "connection"/"router" module to "bindings". (Closed)
Patch Set: Created 4 years 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
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 /** 5 /**
6 * Takes the |pluginsData| input argument which represents data about the 6 * Takes the |pluginsData| input argument which represents data about the
7 * currently installed/running plugins and populates the html jstemplate with 7 * currently installed/running plugins and populates the html jstemplate with
8 * that data. 8 * that data.
9 * @param {Object} pluginsData Detailed info about installed plugins. Same 9 * @param {Object} pluginsData Detailed info about installed plugins. Same
10 * expected format as returnPluginsData(). 10 * expected format as returnPluginsData().
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 // NOTE: Need to keep a global reference to the |pageImpl| such that it is not 222 // NOTE: Need to keep a global reference to the |pageImpl| such that it is not
223 // garbage collected, which causes the pipe to close and future calls from C++ 223 // garbage collected, which causes the pipe to close and future calls from C++
224 // to JS to get dropped. This also allows tests to make direct calls on it. 224 // to JS to get dropped. This also allows tests to make direct calls on it.
225 var pageImpl = null; 225 var pageImpl = null;
226 var browserProxy = null; 226 var browserProxy = null;
227 227
228 function initializeProxies() { 228 function initializeProxies() {
229 return importModules([ 229 return importModules([
230 'mojo/public/js/bindings', 230 'mojo/public/js/bindings',
231 'mojo/public/js/connection',
231 'chrome/browser/ui/webui/plugins/plugins.mojom', 232 'chrome/browser/ui/webui/plugins/plugins.mojom',
232 'content/public/renderer/frame_interfaces', 233 'content/public/renderer/frame_interfaces',
233 ]).then(function(modules) { 234 ]).then(function(modules) {
234 var bindings = modules[0]; 235 var bindings = modules[0];
235 var pluginsMojom = modules[1]; 236 var connection = modules[1];
236 var frameInterfaces = modules[2]; 237 var pluginsMojom = modules[2];
238 var frameInterfaces = modules[3];
237 239
238 browserProxy = new pluginsMojom.PluginsPageHandlerPtr( 240 browserProxy = connection.bindHandleToProxy(
239 frameInterfaces.getInterface(pluginsMojom.PluginsPageHandler.name)); 241 frameInterfaces.getInterface(pluginsMojom.PluginsPageHandler.name),
242 pluginsMojom.PluginsPageHandler);
240 243
241 /** @constructor */ 244 /** @constructor */
242 var PluginsPageImpl = function() { 245 var PluginsPageImpl = function() {
243 this.binding = new bindings.Binding(pluginsMojom.PluginsPage, this); 246 this.binding = new bindings.Binding(pluginsMojom.PluginsPage, this);
244 }; 247 };
245 248
246 PluginsPageImpl.prototype = { 249 PluginsPageImpl.prototype = {
247 /** @override */ 250 /** @override */
248 onPluginsUpdated: function(plugins) { 251 onPluginsUpdated: function(plugins) {
249 returnPluginsData({plugins: plugins}); 252 returnPluginsData({plugins: plugins});
(...skipping 30 matching lines...) Expand all
280 283
281 // Unfortunately, we don't have notifications for plugin (list) status 284 // Unfortunately, we don't have notifications for plugin (list) status
282 // changes (yet), so in the meanwhile just update regularly. 285 // changes (yet), so in the meanwhile just update regularly.
283 setInterval(function() { 286 setInterval(function() {
284 browserProxy.getPluginsData().then(returnPluginsData); 287 browserProxy.getPluginsData().then(returnPluginsData);
285 }, 30000); 288 }, 30000);
286 }); 289 });
287 } 290 }
288 291
289 document.addEventListener('DOMContentLoaded', main); 292 document.addEventListener('DOMContentLoaded', main);
OLDNEW
« no previous file with comments | « chrome/browser/resources/omnibox/omnibox.js ('k') | chrome/browser/resources/usb_internals/usb_internals.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698