Bug 1561227 Part 2: Define and fire an internal event when BrowserChild has finished resizing. r=botond,emilio

This event is useful for tests that resize the RDM pane and need to
know when all resolution adjusting effects are complete.

Differential Revision: https://phabricator.services.mozilla.com/D47364

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brad Werth 2019-10-24 23:42:52 +00:00
Родитель bd10652c59
Коммит 5007e7e93c
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -16,6 +16,7 @@
#include "BrowserParent.h"
#include "js/JSON.h"
#include "mozilla/Preferences.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/BrowserElementParent.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/EventListenerManager.h"
@ -1262,6 +1263,18 @@ mozilla::ipc::IPCResult BrowserChild::RecvUpdateDimensions(
screenRect.y + mClientOffset.y + mChromeOffset.y,
screenSize.width, screenSize.height, true);
// For our devtools Responsive Design Mode, we need to send a special
// event to indicate that we've finished processing a frame size change.
// This is used by RDM to respond correctly to changes to full zoom,
// which also change the window size.
RefPtr<Document> doc = GetTopLevelDocument();
if (doc && doc->InRDMPane()) {
RefPtr<AsyncEventDispatcher> dispatcher = new AsyncEventDispatcher(
doc, NS_LITERAL_STRING("mozupdatedremoteframedimensions"),
CanBubble::eYes, ChromeOnlyDispatch::eYes);
dispatcher->PostDOMEvent();
}
return IPC_OK();
}