Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 209353003: Clean up handling of autosizing state changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@crap_base
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 #include "core/page/DragSession.h" 106 #include "core/page/DragSession.h"
107 #include "core/page/EventHandler.h" 107 #include "core/page/EventHandler.h"
108 #include "core/page/FocusController.h" 108 #include "core/page/FocusController.h"
109 #include "core/page/FrameTree.h" 109 #include "core/page/FrameTree.h"
110 #include "core/page/InjectedStyleSheets.h" 110 #include "core/page/InjectedStyleSheets.h"
111 #include "core/page/Page.h" 111 #include "core/page/Page.h"
112 #include "core/page/PagePopupClient.h" 112 #include "core/page/PagePopupClient.h"
113 #include "core/page/PointerLockController.h" 113 #include "core/page/PointerLockController.h"
114 #include "core/page/ScopedPageLoadDeferrer.h" 114 #include "core/page/ScopedPageLoadDeferrer.h"
115 #include "core/page/TouchDisambiguation.h" 115 #include "core/page/TouchDisambiguation.h"
116 #include "core/rendering/FastTextAutosizer.h"
116 #include "core/rendering/RenderView.h" 117 #include "core/rendering/RenderView.h"
117 #include "core/rendering/RenderWidget.h" 118 #include "core/rendering/RenderWidget.h"
118 #include "core/rendering/TextAutosizer.h" 119 #include "core/rendering/TextAutosizer.h"
119 #include "core/rendering/compositing/RenderLayerCompositor.h" 120 #include "core/rendering/compositing/RenderLayerCompositor.h"
120 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h" 121 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h"
121 #include "modules/geolocation/GeolocationController.h" 122 #include "modules/geolocation/GeolocationController.h"
122 #include "modules/indexeddb/InspectorIndexedDBAgent.h" 123 #include "modules/indexeddb/InspectorIndexedDBAgent.h"
123 #include "modules/notifications/NotificationController.h" 124 #include "modules/notifications/NotificationController.h"
124 #include "painting/ContinuousPainter.h" 125 #include "painting/ContinuousPainter.h"
125 #include "platform/ContextMenu.h" 126 #include "platform/ContextMenu.h"
(...skipping 2738 matching lines...) Expand 10 before | Expand all | Expand 10 after
2864 } 2865 }
2865 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve rviewMode(), settingsImpl()->viewportMetaNonUserScalableQuirk()); 2866 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve rviewMode(), settingsImpl()->viewportMetaNonUserScalableQuirk());
2866 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; 2867 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale;
2867 if (oldInitialScale != newInitialScale && newInitialScale != -1) { 2868 if (oldInitialScale != newInitialScale && newInitialScale != -1) {
2868 m_pageScaleConstraintsSet.setNeedsReset(true); 2869 m_pageScaleConstraintsSet.setNeedsReset(true);
2869 if (mainFrameImpl() && mainFrameImpl()->frameView()) 2870 if (mainFrameImpl() && mainFrameImpl()->frameView())
2870 mainFrameImpl()->frameView()->setNeedsLayout(); 2871 mainFrameImpl()->frameView()->setNeedsLayout();
2871 } 2872 }
2872 2873
2873 updateMainFrameLayoutSize(); 2874 updateMainFrameLayoutSize();
2875
2876 if (LocalFrame* frame = page()->mainFrame()) {
2877 if (FastTextAutosizer* textAutosizer = frame->document()->fastTextAutosi zer())
2878 textAutosizer->updatePageInfoInAllFrames();
2879 }
2874 } 2880 }
2875 2881
2876 void WebViewImpl::updateMainFrameLayoutSize() 2882 void WebViewImpl::updateMainFrameLayoutSize()
2877 { 2883 {
2878 if (m_fixedLayoutSizeLock || !mainFrameImpl()) 2884 if (m_fixedLayoutSizeLock || !mainFrameImpl())
2879 return; 2885 return;
2880 2886
2881 RefPtr<FrameView> view = mainFrameImpl()->frameView(); 2887 RefPtr<FrameView> view = mainFrameImpl()->frameView();
2882 if (!view) 2888 if (!view)
2883 return; 2889 return;
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
3997 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4003 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
3998 4004
3999 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4005 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4000 return false; 4006 return false;
4001 4007
4002 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4008 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4003 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4009 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4004 } 4010 }
4005 4011
4006 } // namespace blink 4012 } // namespace blink
OLDNEW
« Source/core/rendering/FastTextAutosizer.cpp ('K') | « Source/core/rendering/FastTextAutosizer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698