Change some floating point constants from 1.0 to 1.
[WebKit.git] / Source / WebKit2 / WebProcess / WebCoreSupport / WebFrameLoaderClient.cpp
index 49ce240772e3b7ab1197c3b42fba38cdc92ecb50..49452f9928169ee3a75c6d46482936b0ae561310 100644 (file)
@@ -57,6 +57,7 @@
 #include <WebCore/FrameView.h>
 #include <WebCore/HTMLAppletElement.h>
 #include <WebCore/HTMLFormElement.h>
+#include <WebCore/HistoryItem.h>
 #include <WebCore/MIMETypeRegistry.h>
 #include <WebCore/MouseEvent.h>
 #include <WebCore/Page.h>
@@ -426,7 +427,14 @@ void WebFrameLoaderClient::dispatchDidCommitLoad()
     webPage->sandboxExtensionTracker().didCommitProvisionalLoad(m_frame);
 
     // Notify the UIProcess.
+
     webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), response.mimeType(), m_frameHasCustomRepresentation, PlatformCertificateInfo(response), InjectedBundleUserMessageEncoder(userData.get())));
+
+    // Only restore the scale factor for standard frame loads (of the main frame).
+    if (m_frame->isMainFrame() && m_frame->coreFrame()->loader()->loadType() == FrameLoadTypeStandard) {
+        if (m_frame->coreFrame()->pageScaleFactor() != 1)
+            webPage->scaleWebView(1, IntPoint());
+    }
 }
 
 void WebFrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError& error)
@@ -1003,7 +1011,9 @@ void WebFrameLoaderClient::saveViewStateToItem(HistoryItem*)
 
 void WebFrameLoaderClient::restoreViewState()
 {
-    notImplemented();
+    // Inform the UI process of the scale factor.
+    double scaleFactor = m_frame->coreFrame()->loader()->history()->currentItem()->pageScaleFactor();
+    m_frame->page()->send(Messages::WebPageProxy::ViewScaleFactorDidChange(scaleFactor));
 }
 
 void WebFrameLoaderClient::provisionalLoadStarted()