Bug 1478519 - Introduce a utility method calling some notification method for nsIPresShell. r=karlt

MozReview-Commit-ID: 1uO3uZeuU4N

--HG--
extra : rebase_source : 706685ad0c32bbf2bde23dc5a0dc2daa2a9f9bc3
This commit is contained in:
Hiroyuki Ikezoe 2018-07-27 14:36:57 +09:00
Родитель e2bd8118b8
Коммит 6fd7b21784
2 изменённых файлов: 20 добавлений и 22 удалений

Просмотреть файл

@ -1832,18 +1832,6 @@ nsBaseWidget::NotifyWindowDestroyed()
}
}
void
nsBaseWidget::NotifySizeMoveDone()
{
if (!mWidgetListener || mWidgetListener->GetXULWindow())
return;
nsIPresShell* presShell = mWidgetListener->GetPresShell();
if (presShell) {
presShell->WindowSizeMoveDone();
}
}
void
nsBaseWidget::NotifyWindowMoved(int32_t aX, int32_t aY)
{
@ -1857,27 +1845,34 @@ nsBaseWidget::NotifyWindowMoved(int32_t aX, int32_t aY)
}
void
nsBaseWidget::NotifySysColorChanged()
nsBaseWidget::NotifyPresShell(NotificationFunc aNotificationFunc)
{
if (!mWidgetListener || mWidgetListener->GetXULWindow())
if (!mWidgetListener || mWidgetListener->GetXULWindow()) {
return;
}
nsIPresShell* presShell = mWidgetListener->GetPresShell();
if (presShell) {
presShell->SysColorChanged();
(presShell->*aNotificationFunc)();
}
}
void
nsBaseWidget::NotifySizeMoveDone()
{
NotifyPresShell(&nsIPresShell::WindowSizeMoveDone);
}
void
nsBaseWidget::NotifySysColorChanged()
{
NotifyPresShell(&nsIPresShell::SysColorChanged);
}
void
nsBaseWidget::NotifyThemeChanged()
{
if (!mWidgetListener || mWidgetListener->GetXULWindow())
return;
nsIPresShell* presShell = mWidgetListener->GetPresShell();
if (presShell) {
presShell->ThemeChanged();
}
NotifyPresShell(&nsIPresShell::ThemeChanged);
}
void

Просмотреть файл

@ -319,6 +319,9 @@ public:
bool AsyncPanZoomEnabled() const override;
typedef void (nsIPresShell::*NotificationFunc)(void);
void NotifyPresShell(NotificationFunc aNotificationFunc);
void NotifyWindowDestroyed();
void NotifySizeMoveDone();
void NotifyWindowMoved(int32_t aX, int32_t aY);