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 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 // Control-Up/Down should be PageUp/Down on Mac. | 1402 // Control-Up/Down should be PageUp/Down on Mac. |
1403 if (modifiers & WebMouseEvent::ControlKey) { | 1403 if (modifiers & WebMouseEvent::ControlKey) { |
1404 if (keyCode == VKEY_UP) | 1404 if (keyCode == VKEY_UP) |
1405 keyCode = VKEY_PRIOR; | 1405 keyCode = VKEY_PRIOR; |
1406 else if (keyCode == VKEY_DOWN) | 1406 else if (keyCode == VKEY_DOWN) |
1407 keyCode = VKEY_NEXT; | 1407 keyCode = VKEY_NEXT; |
1408 } | 1408 } |
1409 #endif | 1409 #endif |
1410 if (!mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranularity)) | 1410 if (!mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranularity)) |
1411 return false; | 1411 return false; |
1412 return bubblingScroll(scrollDirection, scrollGranularity); | 1412 |
| 1413 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); |
| 1414 if (!frame) |
| 1415 return false; |
| 1416 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari
ty); |
1413 } | 1417 } |
1414 | 1418 |
1415 bool WebViewImpl::mapKeyCodeForScroll(int keyCode, | 1419 bool WebViewImpl::mapKeyCodeForScroll(int keyCode, |
1416 WebCore::ScrollDirection* scrollDirection, | 1420 WebCore::ScrollDirection* scrollDirection, |
1417 WebCore::ScrollGranularity* scrollGranular
ity) | 1421 WebCore::ScrollGranularity* scrollGranular
ity) |
1418 { | 1422 { |
1419 switch (keyCode) { | 1423 switch (keyCode) { |
1420 case VKEY_LEFT: | 1424 case VKEY_LEFT: |
1421 *scrollDirection = ScrollLeft; | 1425 *scrollDirection = ScrollLeft; |
1422 *scrollGranularity = ScrollByLine; | 1426 *scrollGranularity = ScrollByLine; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 | 1459 |
1456 return true; | 1460 return true; |
1457 } | 1461 } |
1458 | 1462 |
1459 void WebViewImpl::hideSelectPopup() | 1463 void WebViewImpl::hideSelectPopup() |
1460 { | 1464 { |
1461 if (m_selectPopup) | 1465 if (m_selectPopup) |
1462 m_selectPopup->hidePopup(); | 1466 m_selectPopup->hidePopup(); |
1463 } | 1467 } |
1464 | 1468 |
1465 bool WebViewImpl::bubblingScroll(ScrollDirection scrollDirection, ScrollGranular
ity scrollGranularity) | |
1466 { | |
1467 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); | |
1468 if (!frame) | |
1469 return false; | |
1470 | |
1471 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari
ty); | |
1472 } | |
1473 | |
1474 void WebViewImpl::popupOpened(PopupContainer* popupContainer) | 1469 void WebViewImpl::popupOpened(PopupContainer* popupContainer) |
1475 { | 1470 { |
1476 ASSERT(!m_selectPopup); | 1471 ASSERT(!m_selectPopup); |
1477 m_selectPopup = popupContainer; | 1472 m_selectPopup = popupContainer; |
1478 ASSERT(mainFrameImpl()->frame()->document()); | 1473 ASSERT(mainFrameImpl()->frame()->document()); |
1479 Document& document = *mainFrameImpl()->frame()->document(); | 1474 Document& document = *mainFrameImpl()->frame()->document(); |
1480 page()->frameHost().eventHandlerRegistry().didAddEventHandler(document, Even
tHandlerRegistry::WheelEvent); | 1475 page()->frameHost().eventHandlerRegistry().didAddEventHandler(document, Even
tHandlerRegistry::WheelEvent); |
1481 } | 1476 } |
1482 | 1477 |
1483 void WebViewImpl::popupClosed(PopupContainer* popupContainer) | 1478 void WebViewImpl::popupClosed(PopupContainer* popupContainer) |
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4153 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4148 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4154 | 4149 |
4155 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4150 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4156 return false; | 4151 return false; |
4157 | 4152 |
4158 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4153 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4159 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4154 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4160 } | 4155 } |
4161 | 4156 |
4162 } // namespace blink | 4157 } // namespace blink |
OLD | NEW |