refactor: use base::ObserverList::Notify() (#46897)

* refactor: use ObserverList::Notify() in shell/browser/window_list.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/web_contents_zoom_controller.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/usb/usb_chooser_context.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/usb/electron_usb_delegate.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/ui/views/menu_delegate.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/ui/tray_icon.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/ui/electron_menu_model.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/serial/serial_chooser_context.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/native_window.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/serial/electron_serial_delegate.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/browser.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/api/electron_api_web_contents.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/hid/electron_hid_delegate.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ObserverList::Notify() in shell/browser/hid/hid_chooser_context.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2025-05-02 07:51:05 -05:00 committed by GitHub
parent 1687b95849
commit 17e1ff2675
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 134 additions and 229 deletions

View file

@ -101,16 +101,12 @@ void ElectronMenuModel::SetSharingItem(SharingItem item) {
void ElectronMenuModel::MenuWillClose() {
ui::SimpleMenuModel::MenuWillClose();
for (Observer& observer : observers_) {
observer.OnMenuWillClose();
}
observers_.Notify(&Observer::OnMenuWillClose);
}
void ElectronMenuModel::MenuWillShow() {
ui::SimpleMenuModel::MenuWillShow();
for (Observer& observer : observers_) {
observer.OnMenuWillShow();
}
observers_.Notify(&Observer::OnMenuWillShow);
}
ElectronMenuModel* ElectronMenuModel::GetSubmenuModelAt(size_t index) {