Bug 1472491: Part 5α - Add DateTimePickerChild actor. r=mconley
authorKris Maglione <maglione.k@gmail.com>
Sun, 29 Jul 2018 23:39:17 -0700
changeset 431480 28f69e0977c46d9df90fa3284c2b57dd946f7d52
parent 431479 868162b370c877ef1ac9c9129010bcfe914ad0ed
child 431481 83ab8ab55813ca7a63155acdfddf629ffd4546b9
push id34443
push usercsabou@mozilla.com
push dateWed, 15 Aug 2018 00:53:32 +0000
treeherdermozilla-central@b80906e2fbc9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1472491
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1472491: Part 5α - Add DateTimePickerChild actor. r=mconley MozReview-Commit-ID: EWTCdNCmE9S
toolkit/actors/DateTimePickerChild.jsm
toolkit/actors/moz.build
toolkit/content/browser-content.js
toolkit/modules/ActorManagerParent.jsm
toolkit/modules/DateTimePickerContent.jsm
toolkit/modules/moz.build
rename from toolkit/modules/DateTimePickerContent.jsm
rename to toolkit/actors/DateTimePickerChild.jsm
--- a/toolkit/modules/DateTimePickerContent.jsm
+++ b/toolkit/actors/DateTimePickerChild.jsm
@@ -1,28 +1,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.defineModuleGetter(this, "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm");
 
-var EXPORTED_SYMBOLS = ["DateTimePickerContent"];
+var EXPORTED_SYMBOLS = ["DateTimePickerChild"];
+
+ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
 
 /**
- * DateTimePickerContent is the communication channel between the input box
+ * DateTimePickerChild is the communication channel between the input box
  * (content) for date/time input types and its picker (chrome).
  */
-class DateTimePickerContent {
+class DateTimePickerChild extends ActorChild {
   /**
    * On init, just listen for the event to open the picker, once the picker is
    * opened, we'll listen for update and close events.
    */
   constructor(global) {
+    super(global);
     this._inputElement = null;
     this._global = global;
   }
 
   /**
    * Cleanup function called when picker is closed.
    */
   close() {
--- a/toolkit/actors/moz.build
+++ b/toolkit/actors/moz.build
@@ -1,16 +1,17 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 FINAL_TARGET_FILES.actors += [
     'AudioPlaybackChild.jsm',
+    'DateTimePickerChild.jsm',
     'FindBarChild.jsm',
     'PopupBlockingChild.jsm',
     'PrintingChild.jsm',
     'SelectChild.jsm',
     'SelectionSourceChild.jsm',
     'ThumbnailsChild.jsm',
     'WebChannelChild.jsm',
     'ZoomChild.jsm',
--- a/toolkit/content/browser-content.js
+++ b/toolkit/content/browser-content.js
@@ -33,22 +33,16 @@ XPCOMUtils.defineLazyProxy(this, "Shield
 });
 
 XPCOMUtils.defineLazyProxy(this, "UITourListener", () => {
   let tmp = {};
   ChromeUtils.import("resource:///modules/ContentUITour.jsm", tmp);
   return new tmp.UITourListener(global);
 });
 
-XPCOMUtils.defineLazyProxy(this, "DateTimePickerContent", () => {
-  let tmp = {};
-  ChromeUtils.import("resource://gre/modules/DateTimePickerContent.jsm", tmp);
-  return new tmp.DateTimePickerContent(this);
-});
-
 // Lazily load the finder code
 addMessageListener("Finder:Initialize", function() {
   let {RemoteFinderListener} = ChromeUtils.import("resource://gre/modules/RemoteFinder.jsm", {});
   new RemoteFinderListener(global);
 });
 
 var AutoScrollListener = {
   handleEvent(event) {
@@ -59,18 +53,16 @@ var AutoScrollListener = {
         this._controller = new AutoScrollController(global);
       }
       this._controller.handleEvent(event);
     }
   }
 };
 Services.els.addSystemEventListener(global, "mousedown", AutoScrollListener, true);
 
-addEventListener("MozOpenDateTimePicker", DateTimePickerContent);
-
 var UnselectedTabHoverObserver = {
   init() {
     addMessageListener("Browser:UnselectedTabHover", this);
     addEventListener("UnselectedTabHover:Enable", this);
     addEventListener("UnselectedTabHover:Disable", this);
     this.init = null;
   },
   receiveMessage(message) {
--- a/toolkit/modules/ActorManagerParent.jsm
+++ b/toolkit/modules/ActorManagerParent.jsm
@@ -107,16 +107,25 @@ let ACTORS = {
         "AudioPlayback",
       ],
       observers: [
         "audio-playback",
       ],
     },
   },
 
+  DateTimePicker: {
+    child: {
+      module: "resource://gre/actors/DateTimePickerChild.jsm",
+      events: {
+        "MozOpenDateTimePicker": {},
+      },
+    },
+  },
+
   FindBar: {
     child: {
       module: "resource://gre/actors/FindBarChild.jsm",
       events: {
         "keypress": {mozSystemGroup: true},
       },
     },
   },
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -191,17 +191,16 @@ EXTRA_JS_MODULES += [
     'CanonicalJSON.jsm',
     'CertUtils.jsm',
     'CharsetMenu.jsm',
     'ClientID.jsm',
     'Color.jsm',
     'Console.jsm',
     'CreditCard.jsm',
     'css-selector.js',
-    'DateTimePickerContent.jsm',
     'DateTimePickerParent.jsm',
     'DeferredTask.jsm',
     'Deprecated.jsm',
     'E10SUtils.jsm',
     'EventEmitter.jsm',
     'FileUtils.jsm',
     'FindBarContent.jsm',
     'Finder.jsm',