Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove UnresponsiveSuppressor altogether #35507

Merged
merged 5 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions filenames.gni
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,6 @@ filenames = {
"shell/browser/ui/tray_icon_observer.h",
"shell/browser/ui/webui/accessibility_ui.cc",
"shell/browser/ui/webui/accessibility_ui.h",
"shell/browser/unresponsive_suppressor.cc",
"shell/browser/unresponsive_suppressor.h",
"shell/browser/web_contents_permission_helper.cc",
"shell/browser/web_contents_permission_helper.h",
"shell/browser/web_contents_preferences.cc",
Expand Down
4 changes: 1 addition & 3 deletions shell/browser/api/electron_api_browser_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "shell/browser/api/electron_api_web_contents_view.h"
#include "shell/browser/browser.h"
#include "shell/browser/native_browser_view.h"
#include "shell/browser/unresponsive_suppressor.h"
#include "shell/browser/web_contents_preferences.h"
#include "shell/browser/window_list.h"
#include "shell/common/color_util.h"
Expand Down Expand Up @@ -544,8 +543,7 @@ void BrowserWindow::ScheduleUnresponsiveEvent(int ms) {

void BrowserWindow::NotifyWindowUnresponsive() {
window_unresponsive_closure_.Cancel();
if (!window_->IsClosed() && window_->IsEnabled() &&
!IsUnresponsiveEventSuppressed()) {
if (!window_->IsClosed() && window_->IsEnabled()) {
Emit("unresponsive");
}
}
Expand Down
2 changes: 0 additions & 2 deletions shell/browser/ui/file_dialog_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "shell/browser/native_window_views.h"
#include "shell/browser/ui/file_dialog.h"
#include "shell/browser/ui/gtk_util.h"
#include "shell/browser/unresponsive_suppressor.h"
#include "shell/common/gin_converters/file_path_converter.h"
#include "ui/base/glib/glib_signal.h"
#include "ui/gtk/gtk_ui.h" // nogncheck
Expand Down Expand Up @@ -222,7 +221,6 @@ class FileChooserDialog {
void AddFilters(const Filters& filters);

electron::NativeWindowViews* parent_;
electron::UnresponsiveSuppressor unresponsive_suppressor_;

GtkFileChooser* dialog_;
GtkWidget* preview_;
Expand Down
2 changes: 0 additions & 2 deletions shell/browser/ui/file_dialog_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "base/win/registry.h"
#include "shell/browser/native_window_views.h"
#include "shell/browser/ui/win/dialog_thread.h"
#include "shell/browser/unresponsive_suppressor.h"
#include "shell/common/gin_converters/file_path_converter.h"

namespace file_dialog {
Expand Down Expand Up @@ -102,7 +101,6 @@ static void SetDefaultFolder(IFileDialog* dialog,

static HRESULT ShowFileDialog(IFileDialog* dialog,
const DialogSettings& settings) {
electron::UnresponsiveSuppressor suppressor;
HWND parent_window =
settings.parent_window
? static_cast<electron::NativeWindowViews*>(settings.parent_window)
Expand Down
3 changes: 0 additions & 3 deletions shell/browser/ui/message_box_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "shell/browser/native_window_observer.h"
#include "shell/browser/native_window_views.h"
#include "shell/browser/ui/gtk_util.h"
#include "shell/browser/unresponsive_suppressor.h"
#include "ui/base/glib/glib_signal.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gtk/gtk_ui.h" // nogncheck
Expand Down Expand Up @@ -187,8 +186,6 @@ class GtkMessageBox : public NativeWindowObserver {
CHROMEG_CALLBACK_0(GtkMessageBox, void, OnCheckboxToggled, GtkWidget*);

private:
electron::UnresponsiveSuppressor unresponsive_suppressor_;

// The id of the dialog.
absl::optional<int> id_;

Expand Down
3 changes: 0 additions & 3 deletions shell/browser/ui/message_box_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "shell/browser/browser.h"
#include "shell/browser/native_window_views.h"
#include "shell/browser/ui/win/dialog_thread.h"
#include "shell/browser/unresponsive_suppressor.h"
#include "ui/gfx/icon_util.h"
#include "ui/gfx/image/image_skia.h"

Expand Down Expand Up @@ -275,7 +274,6 @@ DialogResult ShowTaskDialogUTF8(const MessageBoxSettings& settings,
} // namespace

int ShowMessageBoxSync(const MessageBoxSettings& settings) {
electron::UnresponsiveSuppressor suppressor;
DialogResult result = ShowTaskDialogUTF8(settings, nullptr);
return result.button_id;
}
Expand Down Expand Up @@ -326,7 +324,6 @@ void CloseMessageBox(int id) {
}

void ShowErrorBox(const std::u16string& title, const std::u16string& content) {
electron::UnresponsiveSuppressor suppressor;
ShowTaskDialogWstr(nullptr, MessageBoxType::kError, {}, -1, 0, false,
u"Error", title, content, u"", false, gfx::ImageSkia(),
nullptr);
Expand Down
27 changes: 0 additions & 27 deletions shell/browser/unresponsive_suppressor.cc

This file was deleted.

24 changes: 0 additions & 24 deletions shell/browser/unresponsive_suppressor.h

This file was deleted.