| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "core/frame/FrameHost.h" | 31 #include "core/frame/FrameHost.h" |
| 32 | 32 |
| 33 #include "core/frame/BrowserControls.h" | 33 #include "core/frame/BrowserControls.h" |
| 34 #include "core/frame/EventHandlerRegistry.h" | 34 #include "core/frame/EventHandlerRegistry.h" |
| 35 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
| 36 #include "core/frame/PageScaleConstraints.h" | 36 #include "core/frame/PageScaleConstraints.h" |
| 37 #include "core/frame/PageScaleConstraintsSet.h" | |
| 38 #include "core/frame/VisualViewport.h" | 37 #include "core/frame/VisualViewport.h" |
| 39 #include "core/inspector/ConsoleMessageStorage.h" | 38 #include "core/inspector/ConsoleMessageStorage.h" |
| 40 #include "core/page/Page.h" | 39 #include "core/page/Page.h" |
| 41 #include "core/page/scrolling/OverscrollController.h" | 40 #include "core/page/scrolling/OverscrollController.h" |
| 42 #include "core/page/scrolling/TopDocumentRootScrollerController.h" | 41 #include "core/page/scrolling/TopDocumentRootScrollerController.h" |
| 43 #include "public/platform/Platform.h" | 42 #include "public/platform/Platform.h" |
| 44 #include "public/platform/WebScheduler.h" | 43 #include "public/platform/WebScheduler.h" |
| 45 | 44 |
| 46 namespace blink { | 45 namespace blink { |
| 47 | 46 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 #endif | 148 #endif |
| 150 | 149 |
| 151 int FrameHost::subframeCount() const { | 150 int FrameHost::subframeCount() const { |
| 152 #if DCHECK_IS_ON() | 151 #if DCHECK_IS_ON() |
| 153 checkFrameCountConsistency(m_subframeCount + 1, m_page->mainFrame()); | 152 checkFrameCountConsistency(m_subframeCount + 1, m_page->mainFrame()); |
| 154 #endif | 153 #endif |
| 155 return m_subframeCount; | 154 return m_subframeCount; |
| 156 } | 155 } |
| 157 | 156 |
| 158 void FrameHost::setDefaultPageScaleLimits(float minScale, float maxScale) { | 157 void FrameHost::setDefaultPageScaleLimits(float minScale, float maxScale) { |
| 159 PageScaleConstraints newDefaults = | 158 page().setDefaultPageScaleLimits(minScale, maxScale); |
| 160 pageScaleConstraintsSet().defaultConstraints(); | |
| 161 newDefaults.minimumScale = minScale; | |
| 162 newDefaults.maximumScale = maxScale; | |
| 163 | |
| 164 if (newDefaults == pageScaleConstraintsSet().defaultConstraints()) | |
| 165 return; | |
| 166 | |
| 167 pageScaleConstraintsSet().setDefaultConstraints(newDefaults); | |
| 168 pageScaleConstraintsSet().computeFinalConstraints(); | |
| 169 pageScaleConstraintsSet().setNeedsReset(true); | |
| 170 | |
| 171 if (!page().mainFrame() || !page().mainFrame()->isLocalFrame()) | |
| 172 return; | |
| 173 | |
| 174 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); | |
| 175 | |
| 176 if (!rootView) | |
| 177 return; | |
| 178 | |
| 179 rootView->setNeedsLayout(); | |
| 180 } | 159 } |
| 181 | 160 |
| 182 void FrameHost::setUserAgentPageScaleConstraints( | 161 void FrameHost::setUserAgentPageScaleConstraints( |
| 183 const PageScaleConstraints& newConstraints) { | 162 const PageScaleConstraints& newConstraints) { |
| 184 if (newConstraints == pageScaleConstraintsSet().userAgentConstraints()) | 163 page().setUserAgentPageScaleConstraints(newConstraints); |
| 185 return; | |
| 186 | |
| 187 pageScaleConstraintsSet().setUserAgentConstraints(newConstraints); | |
| 188 | |
| 189 if (!page().mainFrame() || !page().mainFrame()->isLocalFrame()) | |
| 190 return; | |
| 191 | |
| 192 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); | |
| 193 | |
| 194 if (!rootView) | |
| 195 return; | |
| 196 | |
| 197 rootView->setNeedsLayout(); | |
| 198 } | 164 } |
| 199 | 165 |
| 200 } // namespace blink | 166 } // namespace blink |
| OLD | NEW |