refactor: run Windows SelectFileDialog
out of process (#42780)
This commit is contained in:
parent
0a73b80127
commit
8d1b4652ff
3 changed files with 17 additions and 0 deletions
|
@ -156,9 +156,13 @@ static_library("chrome") {
|
|||
"//chrome/browser/ui/frame/window_frame_util.h",
|
||||
"//chrome/browser/win/chrome_process_finder.cc",
|
||||
"//chrome/browser/win/chrome_process_finder.h",
|
||||
"//chrome/browser/win/chrome_select_file_dialog_factory.cc",
|
||||
"//chrome/browser/win/chrome_select_file_dialog_factory.h",
|
||||
"//chrome/browser/win/titlebar_config.cc",
|
||||
"//chrome/browser/win/titlebar_config.h",
|
||||
"//chrome/browser/win/titlebar_config.h",
|
||||
"//chrome/browser/win/util_win_service.cc",
|
||||
"//chrome/browser/win/util_win_service.h",
|
||||
"//chrome/child/v8_crashpad_support_win.cc",
|
||||
"//chrome/child/v8_crashpad_support_win.h",
|
||||
]
|
||||
|
@ -241,6 +245,7 @@ static_library("chrome") {
|
|||
"//components/webapps/common:mojo_bindings",
|
||||
]
|
||||
deps += [
|
||||
"//chrome/services/util_win/public/mojom",
|
||||
"//components/compose/core/browser:mojo_bindings",
|
||||
"//components/segmentation_platform/public/proto",
|
||||
]
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "chrome/browser/win/chrome_select_file_dialog_factory.h"
|
||||
#include "ui/base/l10n/l10n_util_win.h"
|
||||
#include "ui/gfx/system_fonts_win.h"
|
||||
#include "ui/strings/grit/app_locale_settings.h"
|
||||
|
@ -484,6 +485,11 @@ int ElectronBrowserMainParts::PreMainMessageLoopRun() {
|
|||
|
||||
fake_browser_process_->PreMainMessageLoopRun();
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
ui::SelectFileDialog::SetFactory(
|
||||
std::make_unique<ChromeSelectFileDialogFactory>());
|
||||
#endif
|
||||
|
||||
return GetExitCode();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "chrome/services/util_win/public/mojom/util_read_icon.mojom.h"
|
||||
#include "chrome/services/util_win/public/mojom/util_win.mojom.h"
|
||||
#include "chrome/services/util_win/util_read_icon.h"
|
||||
#include "chrome/services/util_win/util_win_impl.h"
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
|
@ -55,6 +57,9 @@ auto RunWindowsIconReader(
|
|||
mojo::PendingReceiver<chrome::mojom::UtilReadIcon> receiver) {
|
||||
return std::make_unique<UtilReadIcon>(std::move(receiver));
|
||||
}
|
||||
auto RunWindowsUtility(mojo::PendingReceiver<chrome::mojom::UtilWin> receiver) {
|
||||
return std::make_unique<UtilWinImpl>(std::move(receiver));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
|
@ -109,6 +114,7 @@ void ElectronContentUtilityClient::RegisterMainThreadServices(
|
|||
mojo::ServiceFactory& services) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
services.Add(RunWindowsIconReader);
|
||||
services.Add(RunWindowsUtility);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
|
|
Loading…
Reference in a new issue