| 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 | 639 |
| 640 const int newWidth = source.width + leftMargin + rightMargin; | 640 const int newWidth = source.width + leftMargin + rightMargin; |
| 641 const int newX = source.x - leftMargin; | 641 const int newX = source.x - leftMargin; |
| 642 | 642 |
| 643 ASSERT(newWidth >= 0); | 643 ASSERT(newWidth >= 0); |
| 644 ASSERT(scrollOffset.width() + newX + newWidth <= maxSize.width); | 644 ASSERT(scrollOffset.width() + newX + newWidth <= maxSize.width); |
| 645 | 645 |
| 646 return WebRect(newX, source.y, newWidth, source.height); | 646 return WebRect(newX, source.y, newWidth, source.height); |
| 647 } | 647 } |
| 648 | 648 |
| 649 float WebViewImpl::legibleScale() const | |
| 650 { | |
| 651 // Pages should be as legible as on desktop when at dpi scale, so no | |
| 652 // need to zoom in further when automatically determining zoom level | |
| 653 // (after double tap, find in page, etc), though the user should still | |
| 654 // be allowed to manually pinch zoom in further if they desire. | |
| 655 float legibleScale = 1; | |
| 656 if (page()) | |
| 657 legibleScale *= page()->settings().accessibilityFontScaleFactor(); | |
| 658 return legibleScale; | |
| 659 } | |
| 660 | |
| 661 void WebViewImpl::computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, co
nst WebRect& blockRect, float padding, float defaultScaleWhenAlreadyLegible, flo
at& scale, WebPoint& scroll) | 649 void WebViewImpl::computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, co
nst WebRect& blockRect, float padding, float defaultScaleWhenAlreadyLegible, flo
at& scale, WebPoint& scroll) |
| 662 { | 650 { |
| 663 //FIXME(sky) | 651 //FIXME(sky) |
| 664 } | 652 } |
| 665 | 653 |
| 666 static Node* findCursorDefiningAncestor(Node* node, LocalFrame* frame) | 654 static Node* findCursorDefiningAncestor(Node* node, LocalFrame* frame) |
| 667 { | 655 { |
| 668 // Go up the tree to find the node that defines a mouse cursor style | 656 // Go up the tree to find the node that defines a mouse cursor style |
| 669 while (node) { | 657 while (node) { |
| 670 if (node->renderer()) { | 658 if (node->renderer()) { |
| (...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2462 m_layerTreeView->setVisible(visible); | 2450 m_layerTreeView->setVisible(visible); |
| 2463 } | 2451 } |
| 2464 } | 2452 } |
| 2465 | 2453 |
| 2466 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 2454 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 2467 { | 2455 { |
| 2468 return true; | 2456 return true; |
| 2469 } | 2457 } |
| 2470 | 2458 |
| 2471 } // namespace blink | 2459 } // namespace blink |
| OLD | NEW |