| 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 2738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2749 | 2749 |
| 2750 void WebViewImpl::setInitialFocus(bool reverse) | 2750 void WebViewImpl::setInitialFocus(bool reverse) |
| 2751 { | 2751 { |
| 2752 if (!m_page) | 2752 if (!m_page) |
| 2753 return; | 2753 return; |
| 2754 Frame* frame = page()->focusController().focusedOrMainFrame(); | 2754 Frame* frame = page()->focusController().focusedOrMainFrame(); |
| 2755 if (frame->isLocalFrame()) { | 2755 if (frame->isLocalFrame()) { |
| 2756 if (Document* document = toLocalFrame(frame)->document()) | 2756 if (Document* document = toLocalFrame(frame)->document()) |
| 2757 document->setFocusedElement(nullptr); | 2757 document->setFocusedElement(nullptr); |
| 2758 } | 2758 } |
| 2759 page()->focusController().setInitialFocus(reverse ? FocusTypeBackward : Focu
sTypeForward); | 2759 page()->focusController().setInitialFocus(reverse ? WebFocusTypeBackward : W
ebFocusTypeForward); |
| 2760 } | 2760 } |
| 2761 | 2761 |
| 2762 void WebViewImpl::clearFocusedElement() | 2762 void WebViewImpl::clearFocusedElement() |
| 2763 { | 2763 { |
| 2764 RefPtrWillBeRawPtr<Frame> frame = focusedCoreFrame(); | 2764 RefPtrWillBeRawPtr<Frame> frame = focusedCoreFrame(); |
| 2765 if (!frame || !frame->isLocalFrame()) | 2765 if (!frame || !frame->isLocalFrame()) |
| 2766 return; | 2766 return; |
| 2767 | 2767 |
| 2768 LocalFrame* localFrame = toLocalFrame(frame.get()); | 2768 LocalFrame* localFrame = toLocalFrame(frame.get()); |
| 2769 | 2769 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2881 newScroll.setY(textboxRectInDocumentCoordinates.y() - (viewHeight - text
boxRectInDocumentCoordinates.height()) / 2); | 2881 newScroll.setY(textboxRectInDocumentCoordinates.y() - (viewHeight - text
boxRectInDocumentCoordinates.height()) / 2); |
| 2882 } else { | 2882 } else { |
| 2883 // Field is taller than screen. Try to top align field, unless caret wou
ld | 2883 // Field is taller than screen. Try to top align field, unless caret wou
ld |
| 2884 // be offscreen, in which case bottom-align the caret. | 2884 // be offscreen, in which case bottom-align the caret. |
| 2885 newScroll.setY(std::max<int>(textboxRectInDocumentCoordinates.y(), caret
InDocumentCoordinates.y() + caretInDocumentCoordinates.height() + caretPadding -
viewHeight)); | 2885 newScroll.setY(std::max<int>(textboxRectInDocumentCoordinates.y(), caret
InDocumentCoordinates.y() + caretInDocumentCoordinates.height() + caretPadding -
viewHeight)); |
| 2886 } | 2886 } |
| 2887 } | 2887 } |
| 2888 | 2888 |
| 2889 void WebViewImpl::advanceFocus(bool reverse) | 2889 void WebViewImpl::advanceFocus(bool reverse) |
| 2890 { | 2890 { |
| 2891 page()->focusController().advanceFocus(reverse ? FocusTypeBackward : FocusTy
peForward); | 2891 page()->focusController().advanceFocus(reverse ? WebFocusTypeBackward : WebF
ocusTypeForward); |
| 2892 } | 2892 } |
| 2893 | 2893 |
| 2894 double WebViewImpl::zoomLevel() | 2894 double WebViewImpl::zoomLevel() |
| 2895 { | 2895 { |
| 2896 return m_zoomLevel; | 2896 return m_zoomLevel; |
| 2897 } | 2897 } |
| 2898 | 2898 |
| 2899 double WebViewImpl::setZoomLevel(double zoomLevel) | 2899 double WebViewImpl::setZoomLevel(double zoomLevel) |
| 2900 { | 2900 { |
| 2901 if (zoomLevel < m_minimumZoomLevel) | 2901 if (zoomLevel < m_minimumZoomLevel) |
| (...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4529 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4529 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4530 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4530 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4531 } | 4531 } |
| 4532 | 4532 |
| 4533 void WebViewImpl::forceNextWebGLContextCreationToFail() | 4533 void WebViewImpl::forceNextWebGLContextCreationToFail() |
| 4534 { | 4534 { |
| 4535 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4535 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
| 4536 } | 4536 } |
| 4537 | 4537 |
| 4538 } // namespace blink | 4538 } // namespace blink |
| OLD | NEW |