| OLD | NEW |
| 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 3088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3099 m_savedPageScaleFactor = 0; | 3099 m_savedPageScaleFactor = 0; |
| 3100 m_savedScrollOffset = IntSize(); | 3100 m_savedScrollOffset = IntSize(); |
| 3101 } | 3101 } |
| 3102 | 3102 |
| 3103 void WebViewImpl::resetScrollAndScaleState() | 3103 void WebViewImpl::resetScrollAndScaleState() |
| 3104 { | 3104 { |
| 3105 page()->setPageScaleFactor(1, IntPoint()); | 3105 page()->setPageScaleFactor(1, IntPoint()); |
| 3106 | 3106 |
| 3107 // Clear out the values for the current history item. This will prevent the
history item from clobbering the | 3107 // Clear out the values for the current history item. This will prevent the
history item from clobbering the |
| 3108 // value determined during page scale initialization, which may be less than
1. | 3108 // value determined during page scale initialization, which may be less than
1. |
| 3109 page()->mainFrame()->loader().history()->saveDocumentAndScrollState(); | 3109 page()->history()->saveDocumentAndScrollState(page()->mainFrame()); |
| 3110 page()->mainFrame()->loader().history()->clearScrollPositionAndViewState(); | 3110 page()->history()->clearScrollPositionAndViewState(); |
| 3111 m_pageScaleConstraintsSet.setNeedsReset(true); | 3111 m_pageScaleConstraintsSet.setNeedsReset(true); |
| 3112 | 3112 |
| 3113 // Clobber saved scales and scroll offsets. | 3113 // Clobber saved scales and scroll offsets. |
| 3114 if (FrameView* view = page()->mainFrame()->document()->view()) | 3114 if (FrameView* view = page()->mainFrame()->document()->view()) |
| 3115 view->cacheCurrentScrollPosition(); | 3115 view->cacheCurrentScrollPosition(); |
| 3116 resetSavedScrollAndScaleState(); | 3116 resetSavedScrollAndScaleState(); |
| 3117 } | 3117 } |
| 3118 | 3118 |
| 3119 void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize) | 3119 void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize) |
| 3120 { | 3120 { |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4199 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4199 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4200 | 4200 |
| 4201 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4201 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4202 return false; | 4202 return false; |
| 4203 | 4203 |
| 4204 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4204 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4205 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4205 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4206 } | 4206 } |
| 4207 | 4207 |
| 4208 } // namespace blink | 4208 } // namespace blink |
| OLD | NEW |