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

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

Issue 1585793002: Update lifecycle phases when a WebView is resized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 ASSERT(mainFrameImpl() && mainFrameImpl()->frame()->isLocalFrame()); 1895 ASSERT(mainFrameImpl() && mainFrameImpl()->frame()->isLocalFrame());
1896 1896
1897 { 1897 {
1898 // Avoids unnecessary invalidations while various bits of state in TextA utosizer are updated. 1898 // Avoids unnecessary invalidations while various bits of state in TextA utosizer are updated.
1899 TextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page()); 1899 TextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page());
1900 performResize(); 1900 performResize();
1901 } 1901 }
1902 1902
1903 m_fullscreenController->updateSize(); 1903 m_fullscreenController->updateSize();
1904 1904
1905 // Relayout immediately to recalculate the minimum scale limit for rotation anchoring. 1905 // Update lifecyle phases immediately to recalculate the minimum scale limit for rotation anchoring,
1906 if (view->needsLayout()) 1906 // and to make sure that no lifecycle states are stale if this WebView is em bedded in another one.
1907 view->layout(); 1907 updateAllLifecyclePhases();
1908 } 1908 }
1909 1909
1910 void WebViewImpl::resize(const WebSize& newSize) 1910 void WebViewImpl::resize(const WebSize& newSize)
1911 { 1911 {
1912 if (m_shouldAutoResize || m_size == newSize) 1912 if (m_shouldAutoResize || m_size == newSize)
1913 return; 1913 return;
1914 1914
1915 if (page()->mainFrame() && !page()->mainFrame()->isLocalFrame()) { 1915 if (page()->mainFrame() && !page()->mainFrame()->isLocalFrame()) {
1916 // Viewport resize for a remote main frame does not require any 1916 // Viewport resize for a remote main frame does not require any
1917 // particular action, but the state needs to reflect the correct size 1917 // particular action, but the state needs to reflect the correct size
(...skipping 2704 matching lines...) Expand 10 before | Expand all | Expand 10 after
4622 { 4622 {
4623 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4623 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4624 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4624 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4625 if (!page()) 4625 if (!page())
4626 return 1; 4626 return 1;
4627 4627
4628 return page()->deviceScaleFactor(); 4628 return page()->deviceScaleFactor();
4629 } 4629 }
4630 4630
4631 } // namespace blink 4631 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698