| 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 3416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3427 if (!page()->mainFrame()->isLocalFrame()) | 3427 if (!page()->mainFrame()->isLocalFrame()) |
| 3428 return IntSize(); | 3428 return IntSize(); |
| 3429 LayoutViewItem root = page()->deprecatedLocalMainFrame()->contentLayoutItem(
); | 3429 LayoutViewItem root = page()->deprecatedLocalMainFrame()->contentLayoutItem(
); |
| 3430 if (root.isNull()) | 3430 if (root.isNull()) |
| 3431 return IntSize(); | 3431 return IntSize(); |
| 3432 return root.documentRect().size(); | 3432 return root.documentRect().size(); |
| 3433 } | 3433 } |
| 3434 | 3434 |
| 3435 WebSize WebViewImpl::contentsPreferredMinimumSize() | 3435 WebSize WebViewImpl::contentsPreferredMinimumSize() |
| 3436 { | 3436 { |
| 3437 updateAllLifecyclePhases(); | 3437 if (mainFrameImpl()) |
| 3438 mainFrameImpl()->frame()->view()->updateLifecycleToCompositingCleanPlusS
crolling(); |
| 3438 | 3439 |
| 3439 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate
dLocalMainFrame()->document() : nullptr; | 3440 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate
dLocalMainFrame()->document() : nullptr; |
| 3440 if (!document || !document->layoutView() || !document->documentElement() ||
!document->documentElement()->layoutBox()) | 3441 if (!document || !document->layoutView() || !document->documentElement() ||
!document->documentElement()->layoutBox()) |
| 3441 return WebSize(); | 3442 return WebSize(); |
| 3442 | 3443 |
| 3443 int widthScaled = document->layoutView()->minPreferredLogicalWidth().round()
; // Already accounts for zoom. | 3444 int widthScaled = document->layoutView()->minPreferredLogicalWidth().round()
; // Already accounts for zoom. |
| 3444 int heightScaled = document->documentElement()->layoutBox()->scrollHeight().
round(); | 3445 int heightScaled = document->documentElement()->layoutBox()->scrollHeight().
round(); |
| 3445 return IntSize(widthScaled, heightScaled); | 3446 return IntSize(widthScaled, heightScaled); |
| 3446 } | 3447 } |
| 3447 | 3448 |
| (...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4594 { | 4595 { |
| 4595 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4596 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4596 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4597 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4597 if (!page()) | 4598 if (!page()) |
| 4598 return 1; | 4599 return 1; |
| 4599 | 4600 |
| 4600 return page()->deviceScaleFactor(); | 4601 return page()->deviceScaleFactor(); |
| 4601 } | 4602 } |
| 4602 | 4603 |
| 4603 } // namespace blink | 4604 } // namespace blink |
| OLD | NEW |