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 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3224 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); | 3224 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); |
3225 m_pageScaleConstraintsSet.computeFinalConstraints(); | 3225 m_pageScaleConstraintsSet.computeFinalConstraints(); |
3226 | 3226 |
3227 if (settings()->shrinksViewportContentToFit()) { | 3227 if (settings()->shrinksViewportContentToFit()) { |
3228 int verticalScrollbarWidth = 0; | 3228 int verticalScrollbarWidth = 0; |
3229 if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlaySc
rollbar()) | 3229 if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlaySc
rollbar()) |
3230 verticalScrollbarWidth = view->verticalScrollbar()->width(); | 3230 verticalScrollbarWidth = view->verticalScrollbar()->width(); |
3231 m_pageScaleConstraintsSet.adjustFinalConstraintsToContentsSize(contentsS
ize(), verticalScrollbarWidth); | 3231 m_pageScaleConstraintsSet.adjustFinalConstraintsToContentsSize(contentsS
ize(), verticalScrollbarWidth); |
3232 } | 3232 } |
3233 | 3233 |
3234 if (pinchVirtualViewportEnabled()) | 3234 if (pinchVirtualViewportEnabled()) { |
3235 mainFrameImpl()->frameView()->resize(m_pageScaleConstraintsSet.mainFrame
Size(contentsSize())); | 3235 int contentAndScrollbarWidth = contentsSize().width(); |
| 3236 if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlaySc
rollbar()) |
| 3237 contentAndScrollbarWidth += view->verticalScrollbar()->width(); |
| 3238 |
| 3239 view->resize(m_pageScaleConstraintsSet.mainFrameSize(contentAndScrollbar
Width)); |
| 3240 } |
3236 | 3241 |
3237 float newPageScaleFactor = pageScaleFactor(); | 3242 float newPageScaleFactor = pageScaleFactor(); |
3238 if (m_pageScaleConstraintsSet.needsReset() && m_pageScaleConstraintsSet.fina
lConstraints().initialScale != -1) { | 3243 if (m_pageScaleConstraintsSet.needsReset() && m_pageScaleConstraintsSet.fina
lConstraints().initialScale != -1) { |
3239 newPageScaleFactor = m_pageScaleConstraintsSet.finalConstraints().initia
lScale; | 3244 newPageScaleFactor = m_pageScaleConstraintsSet.finalConstraints().initia
lScale; |
3240 m_pageScaleConstraintsSet.setNeedsReset(false); | 3245 m_pageScaleConstraintsSet.setNeedsReset(false); |
3241 } | 3246 } |
3242 setPageScaleFactor(newPageScaleFactor); | 3247 setPageScaleFactor(newPageScaleFactor); |
3243 | 3248 |
3244 updateLayerTreeViewport(); | 3249 updateLayerTreeViewport(); |
3245 | 3250 |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4473 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4478 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4474 | 4479 |
4475 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4480 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4476 return false; | 4481 return false; |
4477 | 4482 |
4478 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4483 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4479 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4484 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4480 } | 4485 } |
4481 | 4486 |
4482 } // namespace blink | 4487 } // namespace blink |
OLD | NEW |