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 3379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3390 if (!page()->mainFrame()->isLocalFrame()) | 3390 if (!page()->mainFrame()->isLocalFrame()) |
3391 return IntSize(); | 3391 return IntSize(); |
3392 LayoutView* root = page()->deprecatedLocalMainFrame()->contentLayoutObject()
; | 3392 LayoutView* root = page()->deprecatedLocalMainFrame()->contentLayoutObject()
; |
3393 if (!root) | 3393 if (!root) |
3394 return IntSize(); | 3394 return IntSize(); |
3395 return root->documentRect().size(); | 3395 return root->documentRect().size(); |
3396 } | 3396 } |
3397 | 3397 |
3398 WebSize WebViewImpl::contentsPreferredMinimumSize() | 3398 WebSize WebViewImpl::contentsPreferredMinimumSize() |
3399 { | 3399 { |
| 3400 layout(); |
| 3401 |
3400 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate
dLocalMainFrame()->document() : 0; | 3402 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate
dLocalMainFrame()->document() : 0; |
3401 if (!document || !document->layoutView() || !document->documentElement() ||
!document->documentElement()->layoutBox()) | 3403 if (!document || !document->layoutView() || !document->documentElement() ||
!document->documentElement()->layoutBox()) |
3402 return WebSize(); | 3404 return WebSize(); |
3403 | 3405 |
3404 layout(); | |
3405 int widthScaled = document->layoutView()->minPreferredLogicalWidth().round()
; // Already accounts for zoom. | 3406 int widthScaled = document->layoutView()->minPreferredLogicalWidth().round()
; // Already accounts for zoom. |
3406 int heightScaled = document->documentElement()->layoutBox()->scrollHeight().
round(); | 3407 int heightScaled = document->documentElement()->layoutBox()->scrollHeight().
round(); |
3407 return IntSize(widthScaled, heightScaled); | 3408 return IntSize(widthScaled, heightScaled); |
3408 } | 3409 } |
3409 | 3410 |
3410 void WebViewImpl::enableViewport() | 3411 void WebViewImpl::enableViewport() |
3411 { | 3412 { |
3412 settings()->setViewportEnabled(true); | 3413 settings()->setViewportEnabled(true); |
3413 } | 3414 } |
3414 | 3415 |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4510 if (m_pageColorOverlay) | 4511 if (m_pageColorOverlay) |
4511 m_pageColorOverlay->update(); | 4512 m_pageColorOverlay->update(); |
4512 if (m_inspectorOverlay) { | 4513 if (m_inspectorOverlay) { |
4513 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); | 4514 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); |
4514 if (inspectorPageOverlay) | 4515 if (inspectorPageOverlay) |
4515 inspectorPageOverlay->update(); | 4516 inspectorPageOverlay->update(); |
4516 } | 4517 } |
4517 } | 4518 } |
4518 | 4519 |
4519 } // namespace blink | 4520 } // namespace blink |
OLD | NEW |