summaryrefslogtreecommitdiffstats
path: root/widget/nsContentProcessWidgetFactory.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /widget/nsContentProcessWidgetFactory.cpp
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/nsContentProcessWidgetFactory.cpp')
-rw-r--r--widget/nsContentProcessWidgetFactory.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/widget/nsContentProcessWidgetFactory.cpp b/widget/nsContentProcessWidgetFactory.cpp
new file mode 100644
index 0000000000..70d91f1f1d
--- /dev/null
+++ b/widget/nsContentProcessWidgetFactory.cpp
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=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 "mozilla/ModuleUtils.h"
+#include "nsWidgetsCID.h"
+#include "nsClipboardProxy.h"
+#include "nsColorPickerProxy.h"
+#include "nsDragServiceProxy.h"
+#include "nsFilePickerProxy.h"
+#include "nsSoundProxy.h"
+#include "mozilla/widget/ScreenManager.h"
+
+using namespace mozilla;
+using namespace mozilla::widget;
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardProxy)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsColorPickerProxy)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragServiceProxy)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePickerProxy)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsSoundProxy)
+NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ScreenManager,
+ ScreenManager::GetAddRefedSingleton)
+
+NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
+NS_DEFINE_NAMED_CID(NS_COLORPICKER_CID);
+NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID);
+NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
+NS_DEFINE_NAMED_CID(NS_SOUND_CID);
+NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
+
+static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
+ {&kNS_CLIPBOARD_CID, false, nullptr, nsClipboardProxyConstructor,
+ Module::CONTENT_PROCESS_ONLY},
+ {&kNS_COLORPICKER_CID, false, nullptr, nsColorPickerProxyConstructor,
+ Module::CONTENT_PROCESS_ONLY},
+ {&kNS_DRAGSERVICE_CID, false, nullptr, nsDragServiceProxyConstructor,
+ Module::CONTENT_PROCESS_ONLY},
+ {&kNS_FILEPICKER_CID, false, nullptr, nsFilePickerProxyConstructor,
+ Module::CONTENT_PROCESS_ONLY},
+ {&kNS_SOUND_CID, false, nullptr, nsSoundProxyConstructor,
+ Module::CONTENT_PROCESS_ONLY},
+ {&kNS_SCREENMANAGER_CID, false, nullptr, ScreenManagerConstructor,
+ Module::CONTENT_PROCESS_ONLY},
+ {nullptr}};
+
+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/filepicker;1", &kNS_FILEPICKER_CID,
+ Module::CONTENT_PROCESS_ONLY},
+ {"@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID,
+ Module::CONTENT_PROCESS_ONLY},
+ {"@mozilla.org/sound;1", &kNS_SOUND_CID, Module::CONTENT_PROCESS_ONLY},
+ {"@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID,
+ Module::CONTENT_PROCESS_ONLY},
+ {nullptr}};
+
+extern const mozilla::Module kContentProcessWidgetModule = {
+ mozilla::Module::kVersion, kWidgetCIDs, kWidgetContracts};