Skip to content

Commit

Permalink
Merge sync tab branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rojkov authored and tmeshkova committed Feb 4, 2014
1 parent 9b558b1 commit 7a63920
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadParent.cpp
Expand Up @@ -265,8 +265,12 @@ EmbedLiteViewThreadParent::RecvUpdateZoomConstraints(const uint32_t& aPresShellI
const bool& aIsRoot,
const ZoomConstraints& aConstraints)
{
if (aIsRoot) {
mController->SaveZoomConstraints(aConstraints);
}

if (mController->GetManager()) {
mController->GetManager()->UpdateZoomConstraints(ScrollableLayerGuid(mRootLayerTreeId, 0, 0), aConstraints);
mController->GetManager()->UpdateZoomConstraints(ScrollableLayerGuid(mRootLayerTreeId, aPresShellId, aViewId), aConstraints);
}
return true;
}
Expand All @@ -277,7 +281,7 @@ EmbedLiteViewThreadParent::RecvZoomToRect(const uint32_t& aPresShellId,
const CSSRect& aRect)
{
if (mController->GetManager()) {
mController->GetManager()->ZoomToRect(ScrollableLayerGuid(mRootLayerTreeId, 0, 0), aRect);
mController->GetManager()->ZoomToRect(ScrollableLayerGuid(mRootLayerTreeId, aPresShellId, aViewId), aRect);
}
return true;
}
Expand Down
19 changes: 12 additions & 7 deletions embedding/embedlite/utils/TabChildHelper.cpp
Expand Up @@ -206,12 +206,17 @@ TabChildHelper::Observe(nsISupports* aSubject,
const char16_t* aData)
{
if (!strcmp(aTopic, BROWSER_ZOOM_TO_RECT)) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aSubject));
CSSRect rect;
sscanf(NS_ConvertUTF16toUTF8(aData).get(),
"{\"x\":%f,\"y\":%f,\"w\":%f,\"h\":%f}",
&rect.x, &rect.y, &rect.width, &rect.height);
mView->SendZoomToRect(0, 0, rect);
nsCOMPtr<nsIDocument> doc(GetDocument());
uint32_t presShellId;
ViewID viewId;
if (APZCCallbackHelper::GetScrollIdentifiers(doc->GetDocumentElement(),
&presShellId, &viewId)) {
CSSRect rect;
sscanf(NS_ConvertUTF16toUTF8(aData).get(),
"{\"x\":%f,\"y\":%f,\"w\":%f,\"h\":%f}",
&rect.x, &rect.y, &rect.width, &rect.height);
mView->SendZoomToRect(presShellId, viewId, rect);
}
} else if (!strcmp(aTopic, BEFORE_FIRST_PAINT)) {
nsCOMPtr<nsIDocument> subject(do_QueryInterface(aSubject));
nsCOMPtr<nsIDocument> doc(GetDocument());
Expand Down Expand Up @@ -784,7 +789,7 @@ TabChildHelper::HandlePossibleViewportChange()
ZoomConstraints constraints(viewportInfo.IsZoomAllowed(),
viewportInfo.GetMinZoom(),
viewportInfo.GetMaxZoom());
mView->SendUpdateZoomConstraints(0, 0, true, constraints);
mView->SendUpdateZoomConstraints(presShellId, viewId, /* isRoot = */ true, constraints);
}


Expand Down

0 comments on commit 7a63920

Please sign in to comment.