| 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 3053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3064 m_savedPageScaleFactor = 0; | 3064 m_savedPageScaleFactor = 0; |
| 3065 m_savedScrollOffset = IntSize(); | 3065 m_savedScrollOffset = IntSize(); |
| 3066 } | 3066 } |
| 3067 | 3067 |
| 3068 void WebViewImpl::resetScrollAndScaleState() | 3068 void WebViewImpl::resetScrollAndScaleState() |
| 3069 { | 3069 { |
| 3070 page()->setPageScaleFactor(1, IntPoint()); | 3070 page()->setPageScaleFactor(1, IntPoint()); |
| 3071 | 3071 |
| 3072 // Clear out the values for the current history item. This will prevent the
history item from clobbering the | 3072 // Clear out the values for the current history item. This will prevent the
history item from clobbering the |
| 3073 // value determined during page scale initialization, which may be less than
1. | 3073 // value determined during page scale initialization, which may be less than
1. |
| 3074 page()->mainFrame()->loader()->history()->saveDocumentAndScrollState(); | 3074 page()->mainFrame()->loader()->history()->saveDocumentAndScrollState(page()-
>mainFrame()); |
| 3075 page()->mainFrame()->loader()->history()->clearScrollPositionAndViewState(); | 3075 page()->mainFrame()->loader()->history()->clearScrollPositionAndViewState(); |
| 3076 m_pageScaleConstraintsSet.setNeedsReset(true); | 3076 m_pageScaleConstraintsSet.setNeedsReset(true); |
| 3077 | 3077 |
| 3078 // Clobber saved scales and scroll offsets. | 3078 // Clobber saved scales and scroll offsets. |
| 3079 if (FrameView* view = page()->mainFrame()->document()->view()) | 3079 if (FrameView* view = page()->mainFrame()->document()->view()) |
| 3080 view->cacheCurrentScrollPosition(); | 3080 view->cacheCurrentScrollPosition(); |
| 3081 resetSavedScrollAndScaleState(); | 3081 resetSavedScrollAndScaleState(); |
| 3082 } | 3082 } |
| 3083 | 3083 |
| 3084 void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize) | 3084 void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize) |
| (...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4137 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4137 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4138 | 4138 |
| 4139 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4139 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4140 return false; | 4140 return false; |
| 4141 | 4141 |
| 4142 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4142 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4143 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4143 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4144 } | 4144 } |
| 4145 | 4145 |
| 4146 } // namespace WebKit | 4146 } // namespace WebKit |
| OLD | NEW |