Bug 1527615 - Hook up HTML date picker in content tabs; r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 28 Jun 2019 11:34:29 +1200
changeset 35970 537896eeac1b6837f6b14e9b937215571d8ce0e9
parent 35969 f00b3cb050f365d2edf65b0fb83f9035f45b52e6
child 35971 df69ad4936dc613935d1fd45ed3fafb820ecd8ed
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersmkmelin
bugs1527615
Bug 1527615 - Hook up HTML date picker in content tabs; r=mkmelin
mail/base/content/mainPopupSet.inc.xul
mail/base/content/messenger.xul
mail/components/mailGlue.js
--- a/mail/base/content/mainPopupSet.inc.xul
+++ b/mail/base/content/mainPopupSet.inc.xul
@@ -570,8 +570,19 @@
              class="header"
              fmt="&quickFilterBar.glodaUpsell.continueSearch;"
              value=""/>
       <label id="qfb-upsell-line-two"
              fmt="&quickFilterBar.glodaUpsell.pressEnterAndCurrent;"
              value=""/>
     </vbox>
   </tooltip>
+
+  <panel id="DateTimePickerPanel"
+         type="arrow"
+         hidden="true"
+         orient="vertical"
+         noautofocus="true"
+         norolluponanchor="true"
+         consumeoutsideclicks="never"
+         level="parent"
+         tabspecific="true">
+  </panel>
--- a/mail/base/content/messenger.xul
+++ b/mail/base/content/messenger.xul
@@ -703,24 +703,27 @@
                            and displays information like: junk, contains remote
                            images, or is a suspected phishing URL. -->
                       <hbox id="mail-notification-top">
                         <!-- notificationbox will be added here lazily. -->
                       </hbox>
                       <!-- The messagepanewrapper hbox exists to allow
                            extensions to add sidebars to the message. -->
                       <hbox id="messagepanewrapper" flex="1">
-                        <browser id="messagepane" context="mailContext"
-                                 autofind="false" minheight="1" flex="1"
-                                 name="messagepane" tooltip="aHTMLTooltip"
-                                 disablehistory="true" type="content"
-                                 primary="true" src="about:blank"
-                                 onresize="return messagePaneOnResize(event);"
-                                 disablesecurity="true"
-                                 onclick="return contentAreaClick(event);"/>
+                        <stack flex="1">
+                          <browser id="messagepane" context="mailContext"
+                                   datetimepicker="DateTimePickerPanel"
+                                   autofind="false" minheight="1" flex="1"
+                                   name="messagepane" tooltip="aHTMLTooltip"
+                                   disablehistory="true" type="content"
+                                   primary="true" src="about:blank"
+                                   onresize="return messagePaneOnResize(event);"
+                                   disablesecurity="true"
+                                   onclick="return contentAreaClick(event);"/>
+                        </stack>
                       </hbox>
                       <splitter id="attachment-splitter" collapse="after"
                                 resizebefore="closest" resizeafter="closest"
                                 collapsed="true"/>
                       <vbox id="attachmentView" collapsed="true">
 #include msgAttachmentView.inc.xul
                       </vbox>
                       <findbar id="FindToolbar" browserid="messagepane"/>
@@ -745,19 +748,21 @@
             <toolbaritem class="contentTabAddress" align="center" flex="1">
               <hbox align="center" flex="1">
                 <image class="contentTabSecurity"/>
                 <label class="contentTabUrlbar" flex="1"/>
               </hbox>
             </toolbaritem>
           </hbox>
         </vbox>
-        <browser id="dummycontentbrowser" type="content" flex="1"
-                 disablehistory="true" autocompletepopup="PopupAutoComplete"
-                 context="mailContext"/>
+        <stack flex="1">
+          <browser id="dummycontentbrowser" type="content" flex="1"
+                   disablehistory="true" autocompletepopup="PopupAutoComplete"
+                   datetimepicker="DateTimePickerPanel" context="mailContext"/>
+        </stack>
       </vbox>
     </vbox>
 
     <vbox id="chromeTab" collapsed="true">
       <vbox flex="1" class="chromeTabInstance">
         <vbox id="dummychrometoolbox" class="contentTabToolbox">
           <hbox id="dummychrometoolbar" class="contentTabToolbar"></hbox>
         </vbox>
--- a/mail/components/mailGlue.js
+++ b/mail/components/mailGlue.js
@@ -20,16 +20,19 @@ var {RemoteSecuritySettings} = ChromeUti
 XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
   return Services.strings.createBundle("chrome://branding/locale/brand.properties");
 });
 
 XPCOMUtils.defineLazyGetter(this, "gMailBundle", function() {
   return Services.strings.createBundle("chrome://messenger/locale/messenger.properties");
 });
 
+ChromeUtils.defineModuleGetter(this, "DateTimePickerParent",
+                               "resource://gre/modules/DateTimePickerParent.jsm");
+
 ChromeUtils.defineModuleGetter(this, "ActorManagerParent",
                                "resource://gre/modules/ActorManagerParent.jsm");
 
 let ACTORS = {
 };
 
 /**
  * Glue code that should be executed before any windows are opened. Any
@@ -178,16 +181,18 @@ MailGlue.prototype = {
 
     const {ExtensionsUI} = ChromeUtils.import("resource:///modules/ExtensionsUI.jsm");
     ExtensionsUI.checkForSideloadedExtensions();
 
     // Certificates revocation list, etc.
     Services.tm.idleDispatchToMainThread(() => {
       RemoteSecuritySettings.init();
     });
+
+    DateTimePickerParent.init();
   },
 
   _handleLink(aSubject, aData) {
     let linkHandled = aSubject.QueryInterface(Ci.nsISupportsPRBool);
     if (!linkHandled.data) {
       let win = Services.wm.getMostRecentWindow("mail:3pane");
       aData = JSON.parse(aData);
       let tabParams = { contentPage: aData.href, clickHandler: null };