From 3ca8945a612d8ca3fa2c1ee758219c6451e2ec85 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:51:28 +0200 Subject: [PATCH] refactor: remove WindowListObserver::OnWindowAdded() (#42985) refactor: remove WindowListObserver::OnWindowRemove() these have never been used Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr --- shell/browser/window_list.cc | 6 ------ shell/browser/window_list_observer.h | 6 ------ 2 files changed, 12 deletions(-) diff --git a/shell/browser/window_list.cc b/shell/browser/window_list.cc index 1b9505383b65..226ce76e3caa 100644 --- a/shell/browser/window_list.cc +++ b/shell/browser/window_list.cc @@ -51,9 +51,6 @@ void WindowList::AddWindow(NativeWindow* window) { // Push |window| on the appropriate list instance. WindowVector& windows = GetInstance()->windows_; windows.push_back(window); - - for (WindowListObserver& observer : GetObservers()) - observer.OnWindowAdded(window); } // static @@ -61,9 +58,6 @@ void WindowList::RemoveWindow(NativeWindow* window) { WindowVector& windows = GetInstance()->windows_; std::erase(windows, window); - for (WindowListObserver& observer : GetObservers()) - observer.OnWindowRemoved(window); - if (windows.empty()) { for (WindowListObserver& observer : GetObservers()) observer.OnWindowAllClosed(); diff --git a/shell/browser/window_list_observer.h b/shell/browser/window_list_observer.h index 3719b165a4bd..5b7fc8d805f7 100644 --- a/shell/browser/window_list_observer.h +++ b/shell/browser/window_list_observer.h @@ -13,12 +13,6 @@ class NativeWindow; class WindowListObserver : public base::CheckedObserver { public: - // Called immediately after a window is added to the list. - virtual void OnWindowAdded(NativeWindow* window) {} - - // Called immediately after a window is removed from the list. - virtual void OnWindowRemoved(NativeWindow* window) {} - // Called when a window close is cancelled by beforeunload handler. virtual void OnWindowCloseCancelled(NativeWindow* window) {}