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 return IntSize(); | 3390 return IntSize(); |
3391 LayoutView* root = page()->deprecatedLocalMainFrame()->contentLayoutObject()
; | 3391 LayoutView* root = page()->deprecatedLocalMainFrame()->contentLayoutObject()
; |
3392 if (!root) | 3392 if (!root) |
3393 return IntSize(); | 3393 return IntSize(); |
3394 return root->documentRect().size(); | 3394 return root->documentRect().size(); |
3395 } | 3395 } |
3396 | 3396 |
3397 WebSize WebViewImpl::contentsPreferredMinimumSize() | 3397 WebSize WebViewImpl::contentsPreferredMinimumSize() |
3398 { | 3398 { |
3399 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate
dLocalMainFrame()->document() : 0; | 3399 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate
dLocalMainFrame()->document() : 0; |
3400 if (!document || !document->layoutView() || !document->documentElement()) | 3400 if (!document || !document->layoutView() || !document->documentElement() ||
!document->documentElement()->layoutBox()) |
3401 return WebSize(); | 3401 return WebSize(); |
3402 | 3402 |
3403 layout(); | 3403 layout(); |
3404 int widthScaled = document->layoutView()->minPreferredLogicalWidth().round()
; // Already accounts for zoom. | 3404 int widthScaled = document->layoutView()->minPreferredLogicalWidth().round()
; // Already accounts for zoom. |
3405 int heightScaled = static_cast<int>((document->documentElement()->scrollHeig
ht() * zoomLevelToZoomFactor(zoomLevel())) + 0.5); // +0.5 to round rather than
truncating | 3405 int heightScaled = document->documentElement()->layoutBox()->scrollHeight().
round(); |
3406 return IntSize(widthScaled, heightScaled); | 3406 return IntSize(widthScaled, heightScaled); |
3407 } | 3407 } |
3408 | 3408 |
3409 void WebViewImpl::enableViewport() | 3409 void WebViewImpl::enableViewport() |
3410 { | 3410 { |
3411 settings()->setViewportEnabled(true); | 3411 settings()->setViewportEnabled(true); |
3412 } | 3412 } |
3413 | 3413 |
3414 void WebViewImpl::disableViewport() | 3414 void WebViewImpl::disableViewport() |
3415 { | 3415 { |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4501 if (m_pageColorOverlay) | 4501 if (m_pageColorOverlay) |
4502 m_pageColorOverlay->update(); | 4502 m_pageColorOverlay->update(); |
4503 if (m_inspectorOverlay) { | 4503 if (m_inspectorOverlay) { |
4504 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); | 4504 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); |
4505 if (inspectorPageOverlay) | 4505 if (inspectorPageOverlay) |
4506 inspectorPageOverlay->update(); | 4506 inspectorPageOverlay->update(); |
4507 } | 4507 } |
4508 } | 4508 } |
4509 | 4509 |
4510 } // namespace blink | 4510 } // namespace blink |
OLD | NEW |