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
parent e2bd8118b8
commit 6fd7b21784
2 changed files with 20 additions and 22 deletions

View File

@ -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

View File

@ -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);