| 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 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 return scrollViewWithKeyboard(event.windowsKeyCode, event.modifiers)
; | 1552 return scrollViewWithKeyboard(event.windowsKeyCode, event.modifiers)
; |
| 1553 break; | 1553 break; |
| 1554 default: | 1554 default: |
| 1555 break; | 1555 break; |
| 1556 } | 1556 } |
| 1557 return false; | 1557 return false; |
| 1558 } | 1558 } |
| 1559 | 1559 |
| 1560 bool WebViewImpl::scrollViewWithKeyboard(int keyCode, int modifiers) | 1560 bool WebViewImpl::scrollViewWithKeyboard(int keyCode, int modifiers) |
| 1561 { | 1561 { |
| 1562 ScrollDirection scrollDirection; | 1562 ScrollDirectionPhysical scrollDirectionPhysical; |
| 1563 ScrollGranularity scrollGranularity; | 1563 ScrollGranularity scrollGranularity; |
| 1564 #if OS(MACOSX) | 1564 #if OS(MACOSX) |
| 1565 // Control-Up/Down should be PageUp/Down on Mac. | 1565 // Control-Up/Down should be PageUp/Down on Mac. |
| 1566 if (modifiers & WebMouseEvent::ControlKey) { | 1566 if (modifiers & WebMouseEvent::ControlKey) { |
| 1567 if (keyCode == VKEY_UP) | 1567 if (keyCode == VKEY_UP) |
| 1568 keyCode = VKEY_PRIOR; | 1568 keyCode = VKEY_PRIOR; |
| 1569 else if (keyCode == VKEY_DOWN) | 1569 else if (keyCode == VKEY_DOWN) |
| 1570 keyCode = VKEY_NEXT; | 1570 keyCode = VKEY_NEXT; |
| 1571 } | 1571 } |
| 1572 #endif | 1572 #endif |
| 1573 if (!mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranularity)) | 1573 if (!mapKeyCodeForScroll(keyCode, &scrollDirectionPhysical, &scrollGranulari
ty)) |
| 1574 return false; | 1574 return false; |
| 1575 | 1575 |
| 1576 if (LocalFrame* frame = toLocalFrame(focusedCoreFrame())) | 1576 if (LocalFrame* frame = toLocalFrame(focusedCoreFrame())) |
| 1577 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranu
larity); | 1577 return frame->eventHandler().bubblingScroll(toScrollDirection(scrollDire
ctionPhysical), scrollGranularity); |
| 1578 return false; | 1578 return false; |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 bool WebViewImpl::mapKeyCodeForScroll( | 1581 bool WebViewImpl::mapKeyCodeForScroll( |
| 1582 int keyCode, | 1582 int keyCode, |
| 1583 ScrollDirection* scrollDirection, | 1583 ScrollDirectionPhysical* scrollDirection, |
| 1584 ScrollGranularity* scrollGranularity) | 1584 ScrollGranularity* scrollGranularity) |
| 1585 { | 1585 { |
| 1586 switch (keyCode) { | 1586 switch (keyCode) { |
| 1587 case VKEY_LEFT: | 1587 case VKEY_LEFT: |
| 1588 *scrollDirection = ScrollLeft; | 1588 *scrollDirection = ScrollLeft; |
| 1589 *scrollGranularity = ScrollByLine; | 1589 *scrollGranularity = ScrollByLine; |
| 1590 break; | 1590 break; |
| 1591 case VKEY_RIGHT: | 1591 case VKEY_RIGHT: |
| 1592 *scrollDirection = ScrollRight; | 1592 *scrollDirection = ScrollRight; |
| 1593 *scrollGranularity = ScrollByLine; | 1593 *scrollGranularity = ScrollByLine; |
| (...skipping 2935 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 |