NS_IMETHODIMP ZoomConstraintsClient::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { if (SameCOMIdentity(aSubject, mDocument) && BEFORE_FIRST_PAINT.EqualsASCII(aTopic)) { ZCC_LOG("Got a before-first-paint event in %p\n", this); RefreshZoomConstraints(); } else if (NS_PREF_CHANGED.EqualsASCII(aTopic)) { ZCC_LOG("Got a pref-change event in %p\n", this); // We need to run this later because all the pref change listeners need // to execute before we can be guaranteed that gfxPrefs::ForceUserScalable() // returns the updated value. NS_DispatchToMainThread(NS_NewRunnableMethod( this, &ZoomConstraintsClient::RefreshZoomConstraints)); } return NS_OK; }
NS_IMETHODIMP ZoomConstraintsClient::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { if (SameCOMIdentity(aSubject, mDocument) && BEFORE_FIRST_PAINT.EqualsASCII(aTopic)) { ZCC_LOG("Got a before-first-paint event in %p\n", this); RefreshZoomConstraints(); } return NS_OK; }
NS_IMETHODIMP MobileViewportManager::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { if (SameCOMIdentity(aSubject, mDocument) && BEFORE_FIRST_PAINT.EqualsASCII(aTopic)) { MVM_LOG("%p: got a before-first-paint event\n", this); mIsFirstPaint = true; RefreshViewportSize(false); } return NS_OK; }
NS_IMETHODIMP MobileViewportManager::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { if (SameCOMIdentity(aSubject, mDocument) && BEFORE_FIRST_PAINT.EqualsASCII(aTopic)) { MVM_LOG("%p: got a before-first-paint event\n", this); if (!mPainted) { // before-first-paint message arrived before load event SetInitialViewport(); } } return NS_OK; }