mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 17:03:07 +09:00
Bug 1344642 - Part 1: Cleanup dom.forms.datepicker related code
This commit is contained in:
parent
a422978746
commit
36d469a74f
20 changed files with 16 additions and 543 deletions
|
|
@ -65,7 +65,6 @@ XPIDL_SOURCES += [
|
|||
'nsIClipboardHelper.idl',
|
||||
'nsIClipboardOwner.idl',
|
||||
'nsIColorPicker.idl',
|
||||
'nsIDatePicker.idl',
|
||||
'nsIDisplayInfo.idl',
|
||||
'nsIDragService.idl',
|
||||
'nsIDragSession.idl',
|
||||
|
|
@ -151,7 +150,6 @@ UNIFIED_SOURCES += [
|
|||
'nsClipboardProxy.cpp',
|
||||
'nsColorPickerProxy.cpp',
|
||||
'nsContentProcessWidgetFactory.cpp',
|
||||
'nsDatePickerProxy.cpp',
|
||||
'nsDragServiceProxy.cpp',
|
||||
'nsFilePickerProxy.cpp',
|
||||
'nsHTMLFormatConverter.cpp',
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include "nsWidgetsCID.h"
|
||||
#include "nsClipboardProxy.h"
|
||||
#include "nsColorPickerProxy.h"
|
||||
#include "nsDatePickerProxy.h"
|
||||
#include "nsDragServiceProxy.h"
|
||||
#include "nsFilePickerProxy.h"
|
||||
#include "nsScreenManagerProxy.h"
|
||||
|
|
@ -22,7 +21,6 @@ using namespace mozilla::widget;
|
|||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardProxy)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsColorPickerProxy)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDatePickerProxy)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragServiceProxy)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePickerProxy)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerProxy)
|
||||
|
|
@ -30,7 +28,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(PuppetBidiKeyboard)
|
|||
|
||||
NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_COLORPICKER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_DATEPICKER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
|
||||
NS_DEFINE_NAMED_CID(PUPPETBIDIKEYBOARD_CID);
|
||||
|
|
@ -41,8 +38,6 @@ static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
|
|||
Module::CONTENT_PROCESS_ONLY },
|
||||
{ &kNS_COLORPICKER_CID, false, nullptr, nsColorPickerProxyConstructor,
|
||||
Module::CONTENT_PROCESS_ONLY },
|
||||
{ &kNS_DATEPICKER_CID, false, nullptr, nsDatePickerProxyConstructor,
|
||||
Module::CONTENT_PROCESS_ONLY },
|
||||
{ &kNS_DRAGSERVICE_CID, false, nullptr, nsDragServiceProxyConstructor,
|
||||
Module::CONTENT_PROCESS_ONLY },
|
||||
{ &kNS_FILEPICKER_CID, false, nullptr, nsFilePickerProxyConstructor,
|
||||
|
|
@ -57,7 +52,6 @@ static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
|
|||
static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
|
||||
{ "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID, Module::CONTENT_PROCESS_ONLY },
|
||||
{ "@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID, Module::CONTENT_PROCESS_ONLY },
|
||||
{ "@mozilla.org/datepicker;1", &kNS_DATEPICKER_CID, Module::CONTENT_PROCESS_ONLY },
|
||||
{ "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID, Module::CONTENT_PROCESS_ONLY },
|
||||
{ "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID, Module::CONTENT_PROCESS_ONLY },
|
||||
{ "@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID, Module::CONTENT_PROCESS_ONLY },
|
||||
|
|
|
|||
|
|
@ -1,61 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* 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/. */
|
||||
|
||||
#include "nsDatePickerProxy.h"
|
||||
|
||||
#include "mozilla/dom/TabChild.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsDatePickerProxy, nsIDatePicker)
|
||||
|
||||
/* void init (in nsIDOMWindow parent, in AString title, in short mode); */
|
||||
NS_IMETHODIMP
|
||||
nsDatePickerProxy::Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
|
||||
const nsAString& aInitialDate)
|
||||
{
|
||||
TabChild* tabChild = TabChild::GetFrom(aParent);
|
||||
if (!tabChild) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
tabChild->SendPDatePickerConstructor(this,
|
||||
nsString(aTitle),
|
||||
nsString(aInitialDate));
|
||||
NS_ADDREF_THIS(); //Released in DeallocPDatePickerChild
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void open (in nsIDatePickerShownCallback aDatePickerShownCallback); */
|
||||
NS_IMETHODIMP
|
||||
nsDatePickerProxy::Open(nsIDatePickerShownCallback* aDatePickerShownCallback)
|
||||
{
|
||||
NS_ENSURE_STATE(!mCallback);
|
||||
mCallback = aDatePickerShownCallback;
|
||||
|
||||
SendOpen();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
nsDatePickerProxy::RecvCancel()
|
||||
{
|
||||
if (mCallback) {
|
||||
mCallback->Cancel();
|
||||
mCallback = nullptr;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
nsDatePickerProxy::Recv__delete__(const nsString& aDate)
|
||||
{
|
||||
if (mCallback) {
|
||||
mCallback->Done(aDate);
|
||||
mCallback = nullptr;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef nsDatePickerProxy_h
|
||||
#define nsDatePickerProxy_h
|
||||
|
||||
#include "nsIDatePicker.h"
|
||||
|
||||
#include "mozilla/dom/PDatePickerChild.h"
|
||||
|
||||
class nsDatePickerProxy final : public nsIDatePicker,
|
||||
public mozilla::dom::PDatePickerChild
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDATEPICKER
|
||||
|
||||
nsDatePickerProxy() {}
|
||||
|
||||
virtual bool RecvCancel() override;
|
||||
virtual bool Recv__delete__(const nsString& aDate) override;
|
||||
|
||||
private:
|
||||
~nsDatePickerProxy() {}
|
||||
|
||||
nsCOMPtr<nsIDatePickerShownCallback> mCallback;
|
||||
nsString mTitle;
|
||||
nsString mInitialDate;
|
||||
};
|
||||
|
||||
#endif // nsDatePickerProxy_h
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface mozIDOMWindowProxy;
|
||||
|
||||
[scriptable, uuid(13388a28-1b0b-4218-a31b-588f7a4ec26c)]
|
||||
interface nsIDatePickerShownCallback : nsISupports
|
||||
{
|
||||
/**
|
||||
* Callback called when the user selects cancel in the date picker
|
||||
* This callback can not be called after done() is called.
|
||||
*/
|
||||
void cancel();
|
||||
|
||||
/**
|
||||
* Callback called when the user has finished selecting the date
|
||||
*
|
||||
* @param date The new selected date value following the format "YYYY-MM-DD"
|
||||
*/
|
||||
void done(in AString date);
|
||||
};
|
||||
|
||||
[scriptable, uuid(7becfc64-966b-4d53-87d2-9161f36bd3b3)]
|
||||
interface nsIDatePicker : nsISupports
|
||||
{
|
||||
/**
|
||||
* Initialize the date picker widget. The date picker will not be shown until
|
||||
* open() is called.
|
||||
* If the initialDate parameter does not follow the format "YYYY-MM-DD" then
|
||||
* the behavior will be unspecified.
|
||||
*
|
||||
* @param parent nsIDOMWindow parent. This dialog will be dependent
|
||||
* on this parent. parent may be null.
|
||||
* @param title The title for the date picker widget.
|
||||
* @param initialDate The date to show when the widget is opened. The
|
||||
* parameter has to follow the format "YYYY-MM-DD"
|
||||
*/
|
||||
void init(in mozIDOMWindowProxy parent, in AString title, in AString initialDate);
|
||||
|
||||
/**
|
||||
* Opens the date dialog asynchrounously.
|
||||
* The results are provided via the callback object.
|
||||
*/
|
||||
void open(in nsIDatePickerShownCallback callback);
|
||||
};
|
||||
|
|
@ -33,11 +33,6 @@
|
|||
{ 0x0f872c8c, 0x3ee6, 0x46bd, \
|
||||
{ 0x92, 0xa2, 0x69, 0x65, 0x2c, 0x6b, 0x47, 0x4e } }
|
||||
|
||||
/* 0ca832f8-978a-4dc7-a57d-adb803925d39 */
|
||||
#define NS_DATEPICKER_CID \
|
||||
{ 0x0ca832f8, 0x978a, 0x4dc7, \
|
||||
{ 0xa5, 0x7d, 0xad, 0xb8, 0x03, 0x92, 0x5d, 0x39 } }
|
||||
|
||||
/* 2d96b3df-c051-11d1-a827-0040959a28c9 */
|
||||
#define NS_APPSHELL_CID \
|
||||
{ 0x2d96b3df, 0xc051, 0x11d1, \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue