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

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

Issue 2571903003: Mojo JS bindings: switch most usage of "connection"/"router" module to "bindings". (Closed)
Patch Set: remove the changes to web_ui_mojo.js which seemed to cause flakiness. Created 3 years, 12 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
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',
232 'chrome/browser/ui/webui/plugins/plugins.mojom', 231 'chrome/browser/ui/webui/plugins/plugins.mojom',
233 'content/public/renderer/frame_interfaces', 232 'content/public/renderer/frame_interfaces',
234 ]).then(function(modules) { 233 ]).then(function(modules) {
235 var bindings = modules[0]; 234 var bindings = modules[0];
236 var connection = modules[1]; 235 var pluginsMojom = modules[1];
237 var pluginsMojom = modules[2]; 236 var frameInterfaces = modules[2];
238 var frameInterfaces = modules[3];
239 237
240 browserProxy = connection.bindHandleToProxy( 238 browserProxy = new pluginsMojom.PluginsPageHandlerPtr(
241 frameInterfaces.getInterface(pluginsMojom.PluginsPageHandler.name), 239 frameInterfaces.getInterface(pluginsMojom.PluginsPageHandler.name));
242 pluginsMojom.PluginsPageHandler);
243 240
244 /** @constructor */ 241 /** @constructor */
245 var PluginsPageImpl = function() { 242 var PluginsPageImpl = function() {
246 this.binding = new bindings.Binding(pluginsMojom.PluginsPage, this); 243 this.binding = new bindings.Binding(pluginsMojom.PluginsPage, this);
247 }; 244 };
248 245
249 PluginsPageImpl.prototype = { 246 PluginsPageImpl.prototype = {
250 /** @override */ 247 /** @override */
251 onPluginsUpdated: function(plugins) { 248 onPluginsUpdated: function(plugins) {
252 returnPluginsData({plugins: plugins}); 249 returnPluginsData({plugins: plugins});
(...skipping 30 matching lines...) Expand all
283 280
284 // Unfortunately, we don't have notifications for plugin (list) status 281 // Unfortunately, we don't have notifications for plugin (list) status
285 // changes (yet), so in the meanwhile just update regularly. 282 // changes (yet), so in the meanwhile just update regularly.
286 setInterval(function() { 283 setInterval(function() {
287 browserProxy.getPluginsData().then(returnPluginsData); 284 browserProxy.getPluginsData().then(returnPluginsData);
288 }, 30000); 285 }, 30000);
289 }); 286 });
290 } 287 }
291 288
292 document.addEventListener('DOMContentLoaded', main); 289 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