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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 28983004: Split the frame tree logic out of HistoryItem (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 3035 matching lines...) Expand 10 before | Expand all | Expand 10 after
3046 m_savedPageScaleFactor = 0; 3046 m_savedPageScaleFactor = 0;
3047 m_savedScrollOffset = IntSize(); 3047 m_savedScrollOffset = IntSize();
3048 } 3048 }
3049 3049
3050 void WebViewImpl::resetScrollAndScaleState() 3050 void WebViewImpl::resetScrollAndScaleState()
3051 { 3051 {
3052 page()->setPageScaleFactor(1, IntPoint()); 3052 page()->setPageScaleFactor(1, IntPoint());
3053 3053
3054 // Clear out the values for the current history item. This will prevent the history item from clobbering the 3054 // Clear out the values for the current history item. This will prevent the history item from clobbering the
3055 // value determined during page scale initialization, which may be less than 1. 3055 // value determined during page scale initialization, which may be less than 1.
3056 page()->mainFrame()->loader().history()->saveDocumentAndScrollState(); 3056 page()->mainFrame()->loader().history()->saveDocumentAndScrollState(page()-> mainFrame());
3057 page()->mainFrame()->loader().history()->clearScrollPositionAndViewState(); 3057 page()->mainFrame()->loader().history()->clearScrollPositionAndViewState();
3058 m_pageScaleConstraintsSet.setNeedsReset(true); 3058 m_pageScaleConstraintsSet.setNeedsReset(true);
3059 3059
3060 // Clobber saved scales and scroll offsets. 3060 // Clobber saved scales and scroll offsets.
3061 if (FrameView* view = page()->mainFrame()->document()->view()) 3061 if (FrameView* view = page()->mainFrame()->document()->view())
3062 view->cacheCurrentScrollPosition(); 3062 view->cacheCurrentScrollPosition();
3063 resetSavedScrollAndScaleState(); 3063 resetSavedScrollAndScaleState();
3064 } 3064 }
3065 3065
3066 void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize) 3066 void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize)
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
4112 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4112 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4113 4113
4114 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4114 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4115 return false; 4115 return false;
4116 4116
4117 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4117 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4118 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4118 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4119 } 4119 }
4120 4120
4121 } // namespace WebKit 4121 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698