Bug 1535487 - determine rootUrl directly in buglist creator r=tomprince
[gecko.git] / toolkit / actors / ControllersChild.jsm
blobf54ad7dfa4e8bf2bac2153002c99e2035b2dbd07
1 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 var EXPORTED_SYMBOLS = ["ControllersChild"];
9 const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
11 class ControllersChild extends ActorChild {
12   receiveMessage(message) {
13     switch (message.name) {
14       case "ControllerCommands:Do":
15         if (this.docShell.isCommandEnabled(message.data))
16           this.docShell.doCommand(message.data);
17         break;
19       case "ControllerCommands:DoWithParams":
20         var data = message.data;
21         if (this.docShell.isCommandEnabled(data.cmd)) {
22           var params = Cu.createCommandParams();
23           for (var name in data.params) {
24             var value = data.params[name];
25             if (value.type == "long") {
26               params.setLongValue(name, parseInt(value.value));
27             } else {
28               throw Cr.NS_ERROR_NOT_IMPLEMENTED;
29             }
30           }
31           this.docShell.doCommandWithParams(data.cmd, params);
32         }
33         break;
34     }
35   }