| 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 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3036 m_maxAutoSize = maxSize; | 3036 m_maxAutoSize = maxSize; |
| 3037 configureAutoResizeMode(); | 3037 configureAutoResizeMode(); |
| 3038 } | 3038 } |
| 3039 | 3039 |
| 3040 void WebViewImpl::disableAutoResizeMode() { | 3040 void WebViewImpl::disableAutoResizeMode() { |
| 3041 m_shouldAutoResize = false; | 3041 m_shouldAutoResize = false; |
| 3042 configureAutoResizeMode(); | 3042 configureAutoResizeMode(); |
| 3043 } | 3043 } |
| 3044 | 3044 |
| 3045 void WebViewImpl::setDefaultPageScaleLimits(float minScale, float maxScale) { | 3045 void WebViewImpl::setDefaultPageScaleLimits(float minScale, float maxScale) { |
| 3046 return page()->frameHost().setDefaultPageScaleLimits(minScale, maxScale); | 3046 return page()->setDefaultPageScaleLimits(minScale, maxScale); |
| 3047 } | 3047 } |
| 3048 | 3048 |
| 3049 void WebViewImpl::setInitialPageScaleOverride( | 3049 void WebViewImpl::setInitialPageScaleOverride( |
| 3050 float initialPageScaleFactorOverride) { | 3050 float initialPageScaleFactorOverride) { |
| 3051 PageScaleConstraints constraints = | 3051 PageScaleConstraints constraints = |
| 3052 pageScaleConstraintsSet().userAgentConstraints(); | 3052 pageScaleConstraintsSet().userAgentConstraints(); |
| 3053 constraints.initialScale = initialPageScaleFactorOverride; | 3053 constraints.initialScale = initialPageScaleFactorOverride; |
| 3054 | 3054 |
| 3055 if (constraints == pageScaleConstraintsSet().userAgentConstraints()) | 3055 if (constraints == pageScaleConstraintsSet().userAgentConstraints()) |
| 3056 return; | 3056 return; |
| 3057 | 3057 |
| 3058 pageScaleConstraintsSet().setNeedsReset(true); | 3058 pageScaleConstraintsSet().setNeedsReset(true); |
| 3059 page()->frameHost().setUserAgentPageScaleConstraints(constraints); | 3059 page()->setUserAgentPageScaleConstraints(constraints); |
| 3060 } | 3060 } |
| 3061 | 3061 |
| 3062 void WebViewImpl::setMaximumLegibleScale(float maximumLegibleScale) { | 3062 void WebViewImpl::setMaximumLegibleScale(float maximumLegibleScale) { |
| 3063 m_maximumLegibleScale = maximumLegibleScale; | 3063 m_maximumLegibleScale = maximumLegibleScale; |
| 3064 } | 3064 } |
| 3065 | 3065 |
| 3066 void WebViewImpl::setIgnoreViewportTagScaleLimits(bool ignore) { | 3066 void WebViewImpl::setIgnoreViewportTagScaleLimits(bool ignore) { |
| 3067 PageScaleConstraints constraints = | 3067 PageScaleConstraints constraints = |
| 3068 pageScaleConstraintsSet().userAgentConstraints(); | 3068 pageScaleConstraintsSet().userAgentConstraints(); |
| 3069 if (ignore) { | 3069 if (ignore) { |
| 3070 constraints.minimumScale = | 3070 constraints.minimumScale = |
| 3071 pageScaleConstraintsSet().defaultConstraints().minimumScale; | 3071 pageScaleConstraintsSet().defaultConstraints().minimumScale; |
| 3072 constraints.maximumScale = | 3072 constraints.maximumScale = |
| 3073 pageScaleConstraintsSet().defaultConstraints().maximumScale; | 3073 pageScaleConstraintsSet().defaultConstraints().maximumScale; |
| 3074 } else { | 3074 } else { |
| 3075 constraints.minimumScale = -1; | 3075 constraints.minimumScale = -1; |
| 3076 constraints.maximumScale = -1; | 3076 constraints.maximumScale = -1; |
| 3077 } | 3077 } |
| 3078 page()->frameHost().setUserAgentPageScaleConstraints(constraints); | 3078 page()->setUserAgentPageScaleConstraints(constraints); |
| 3079 } | 3079 } |
| 3080 | 3080 |
| 3081 IntSize WebViewImpl::mainFrameSize() { | 3081 IntSize WebViewImpl::mainFrameSize() { |
| 3082 // The frame size should match the viewport size at minimum scale, since the | 3082 // The frame size should match the viewport size at minimum scale, since the |
| 3083 // viewport must always be contained by the frame. | 3083 // viewport must always be contained by the frame. |
| 3084 FloatSize frameSize(m_size); | 3084 FloatSize frameSize(m_size); |
| 3085 frameSize.scale(1 / minimumPageScaleFactor()); | 3085 frameSize.scale(1 / minimumPageScaleFactor()); |
| 3086 return expandedIntSize(frameSize); | 3086 return expandedIntSize(frameSize); |
| 3087 } | 3087 } |
| 3088 | 3088 |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4166 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4166 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
| 4167 return nullptr; | 4167 return nullptr; |
| 4168 return focusedFrame; | 4168 return focusedFrame; |
| 4169 } | 4169 } |
| 4170 | 4170 |
| 4171 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4171 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
| 4172 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4172 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
| 4173 } | 4173 } |
| 4174 | 4174 |
| 4175 } // namespace blink | 4175 } // namespace blink |
| OLD | NEW |