Chromium Code Reviews| 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 3346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3357 return IntSize(); | 3357 return IntSize(); |
| 3358 LayoutView* root = page()->deprecatedLocalMainFrame()->contentRenderer(); | 3358 LayoutView* root = page()->deprecatedLocalMainFrame()->contentRenderer(); |
| 3359 if (!root) | 3359 if (!root) |
| 3360 return IntSize(); | 3360 return IntSize(); |
| 3361 return root->documentRect().size(); | 3361 return root->documentRect().size(); |
| 3362 } | 3362 } |
| 3363 | 3363 |
| 3364 WebSize WebViewImpl::contentsPreferredMinimumSize() | 3364 WebSize WebViewImpl::contentsPreferredMinimumSize() |
| 3365 { | 3365 { |
| 3366 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate dLocalMainFrame()->document() : 0; | 3366 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate dLocalMainFrame()->document() : 0; |
| 3367 if (!document || !document->layoutView() || !document->documentElement()) | 3367 if (!document || !document->layoutView() || !document->documentElement() || !document->documentElement()->layoutBox()) |
| 3368 return WebSize(); | 3368 return WebSize(); |
| 3369 | 3369 |
| 3370 layout(); | 3370 layout(); |
| 3371 int widthScaled = document->layoutView()->minPreferredLogicalWidth(); // Alr eady accounts for zoom. | 3371 int widthScaled = document->layoutView()->minPreferredLogicalWidth(); // Alr eady accounts for zoom. |
| 3372 int heightScaled = static_cast<int>(document->documentElement()->scrollHeigh t() * zoomLevelToZoomFactor(zoomLevel())); | 3372 LayoutBox* documentBox = document->documentElement()->layoutBox(); |
| 3373 int heightScaled = adjustLayoutUnitForAbsoluteZoom(documentBox->scrollHeight (), *documentBox).toInt() * zoomLevelToZoomFactor(zoomLevel()); | |
| 3374 // int heightScaled = static_cast<int>(document->documentElement()->scrollHe ight() * zoomLevelToZoomFactor(zoomLevel())); | |
|
eae
2015/03/25 21:41:04
Remove commented add code and please add a comment
| |
| 3373 return IntSize(widthScaled, heightScaled); | 3375 return IntSize(widthScaled, heightScaled); |
| 3374 } | 3376 } |
| 3375 | 3377 |
| 3376 void WebViewImpl::enableViewport() | 3378 void WebViewImpl::enableViewport() |
| 3377 { | 3379 { |
| 3378 settings()->setViewportEnabled(true); | 3380 settings()->setViewportEnabled(true); |
| 3379 } | 3381 } |
| 3380 | 3382 |
| 3381 void WebViewImpl::disableViewport() | 3383 void WebViewImpl::disableViewport() |
| 3382 { | 3384 { |
| (...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4500 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4502 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4501 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); | 4503 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); |
| 4502 } | 4504 } |
| 4503 | 4505 |
| 4504 void WebViewImpl::forceNextWebGLContextCreationToFail() | 4506 void WebViewImpl::forceNextWebGLContextCreationToFail() |
| 4505 { | 4507 { |
| 4506 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4508 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
| 4507 } | 4509 } |
| 4508 | 4510 |
| 4509 } // namespace blink | 4511 } // namespace blink |
| OLD | NEW |