| 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 3361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3372 } | 3372 } |
| 3373 | 3373 |
| 3374 WebSize WebViewImpl::contentsPreferredMinimumSize() | 3374 WebSize WebViewImpl::contentsPreferredMinimumSize() |
| 3375 { | 3375 { |
| 3376 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate
dLocalMainFrame()->document() : 0; | 3376 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate
dLocalMainFrame()->document() : 0; |
| 3377 if (!document || !document->layoutView() || !document->documentElement()) | 3377 if (!document || !document->layoutView() || !document->documentElement()) |
| 3378 return WebSize(); | 3378 return WebSize(); |
| 3379 | 3379 |
| 3380 layout(); | 3380 layout(); |
| 3381 int widthScaled = document->layoutView()->minPreferredLogicalWidth().round()
; // Already accounts for zoom. | 3381 int widthScaled = document->layoutView()->minPreferredLogicalWidth().round()
; // Already accounts for zoom. |
| 3382 int heightScaled = static_cast<int>(document->documentElement()->scrollHeigh
t() * zoomLevelToZoomFactor(zoomLevel())); | 3382 int heightScaled = static_cast<int>((document->documentElement()->scrollHeig
ht() * zoomLevelToZoomFactor(zoomLevel())) + 0.5); // +0.5 to round rather than
truncating |
| 3383 return IntSize(widthScaled, heightScaled); | 3383 return IntSize(widthScaled, heightScaled); |
| 3384 } | 3384 } |
| 3385 | 3385 |
| 3386 void WebViewImpl::enableViewport() | 3386 void WebViewImpl::enableViewport() |
| 3387 { | 3387 { |
| 3388 settings()->setViewportEnabled(true); | 3388 settings()->setViewportEnabled(true); |
| 3389 } | 3389 } |
| 3390 | 3390 |
| 3391 void WebViewImpl::disableViewport() | 3391 void WebViewImpl::disableViewport() |
| 3392 { | 3392 { |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4508 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4508 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4509 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4509 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4510 } | 4510 } |
| 4511 | 4511 |
| 4512 void WebViewImpl::forceNextWebGLContextCreationToFail() | 4512 void WebViewImpl::forceNextWebGLContextCreationToFail() |
| 4513 { | 4513 { |
| 4514 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4514 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
| 4515 } | 4515 } |
| 4516 | 4516 |
| 4517 } // namespace blink | 4517 } // namespace blink |
| OLD | NEW |