Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(924)

Unified Diff: Source/core/loader/HistoryController.cpp

Issue 59573002: Add Frame::isMainFrame and deploy it (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/page/AutoscrollController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/HistoryController.cpp
diff --git a/Source/core/loader/HistoryController.cpp b/Source/core/loader/HistoryController.cpp
index 0ac94501e9b24d284038ff38b0edd96b5f9d1551..23e1b4e2c7f42217e3b4d4beb02f92d9888686c9 100644
--- a/Source/core/loader/HistoryController.cpp
+++ b/Source/core/loader/HistoryController.cpp
@@ -85,15 +85,14 @@ void HistoryController::restoreScrollPositionAndViewState()
return;
if (FrameView* view = m_frame->view()) {
- Page* page = m_frame->page();
- if (page && page->mainFrame() == m_frame) {
- if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
+ if (m_frame->isMainFrame()) {
+ if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scrollingCoordinator())
scrollingCoordinator->frameViewRootLayerDidChange(view);
}
if (!view->wasScrolledByUser()) {
- if (page && page->mainFrame() == m_frame && m_currentItem->pageScaleFactor())
- page->setPageScaleFactor(m_currentItem->pageScaleFactor(), m_currentItem->scrollPoint());
+ if (m_frame->isMainFrame() && m_currentItem->pageScaleFactor())
+ m_frame->page()->setPageScaleFactor(m_currentItem->pageScaleFactor(), m_currentItem->scrollPoint());
else
view->setScrollPositionNonProgrammatically(m_currentItem->scrollPoint());
}
@@ -124,7 +123,7 @@ void HistoryController::saveDocumentAndScrollState()
m_currentItem->setScrollPoint(m_frame->view()->scrollPosition());
Page* page = m_frame->page();
- if (page && page->mainFrame() == m_frame && !page->inspectorController().deviceEmulationEnabled())
+ if (m_frame->isMainFrame() && !page->inspectorController().deviceEmulationEnabled())
m_currentItem->setPageScaleFactor(page->pageScaleFactor());
}
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/page/AutoscrollController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698