| 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 { | 483 { |
| 484 m_client->setMouseOverURL(WebURL()); | 484 m_client->setMouseOverURL(WebURL()); |
| 485 PageWidgetEventHandler::handleMouseLeave(mainFrame, event); | 485 PageWidgetEventHandler::handleMouseLeave(mainFrame, event); |
| 486 } | 486 } |
| 487 | 487 |
| 488 void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev
ent) | 488 void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev
ent) |
| 489 { | 489 { |
| 490 // If there is a popup open, close it as the user is clicking on the page (o
utside of the | 490 // If there is a popup open, close it as the user is clicking on the page (o
utside of the |
| 491 // popup). We also save it so we can prevent a click on an element from imme
diately | 491 // popup). We also save it so we can prevent a click on an element from imme
diately |
| 492 // reopening the same popup. | 492 // reopening the same popup. |
| 493 RefPtr<PopupContainer> selectPopup; | 493 RefPtrWillBeRawPtr<PopupContainer> selectPopup = nullptr; |
| 494 RefPtr<WebPagePopupImpl> pagePopup; | 494 RefPtr<WebPagePopupImpl> pagePopup; |
| 495 if (event.button == WebMouseEvent::ButtonLeft) { | 495 if (event.button == WebMouseEvent::ButtonLeft) { |
| 496 selectPopup = m_selectPopup; | 496 selectPopup = m_selectPopup; |
| 497 pagePopup = m_pagePopup; | 497 pagePopup = m_pagePopup; |
| 498 hidePopups(); | 498 hidePopups(); |
| 499 ASSERT(!m_selectPopup); | 499 ASSERT(!m_selectPopup); |
| 500 ASSERT(!m_pagePopup); | 500 ASSERT(!m_pagePopup); |
| 501 } | 501 } |
| 502 | 502 |
| 503 m_lastMouseDownPoint = WebPoint(event.x, event.y); | 503 m_lastMouseDownPoint = WebPoint(event.x, event.y); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 } | 731 } |
| 732 | 732 |
| 733 switch (event.type) { | 733 switch (event.type) { |
| 734 case WebInputEvent::GestureTap: { | 734 case WebInputEvent::GestureTap: { |
| 735 m_client->cancelScheduledContentIntents(); | 735 m_client->cancelScheduledContentIntents(); |
| 736 if (detectContentOnTouch(targetedEvent)) { | 736 if (detectContentOnTouch(targetedEvent)) { |
| 737 eventSwallowed = true; | 737 eventSwallowed = true; |
| 738 break; | 738 break; |
| 739 } | 739 } |
| 740 | 740 |
| 741 RefPtr<PopupContainer> selectPopup; | 741 RefPtrWillBeRawPtr<PopupContainer> selectPopup = nullptr; |
| 742 selectPopup = m_selectPopup; | 742 selectPopup = m_selectPopup; |
| 743 hideSelectPopup(); | 743 hideSelectPopup(); |
| 744 ASSERT(!m_selectPopup); | 744 ASSERT(!m_selectPopup); |
| 745 | 745 |
| 746 // Don't trigger a disambiguation popup on sites designed for mobile dev
ices. | 746 // Don't trigger a disambiguation popup on sites designed for mobile dev
ices. |
| 747 // Instead, assume that the page has been designed with big enough butto
ns and links. | 747 // Instead, assume that the page has been designed with big enough butto
ns and links. |
| 748 // Don't trigger a disambiguation popup when screencasting, since it's i
mplemented outside of | 748 // Don't trigger a disambiguation popup when screencasting, since it's i
mplemented outside of |
| 749 // compositor pipeline and is not being screencasted itself. This leads
to bad user experience. | 749 // compositor pipeline and is not being screencasted itself. This leads
to bad user experience. |
| 750 if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds() && !p
age()->inspectorController().screencastEnabled()) { | 750 if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds() && !p
age()->inspectorController().screencastEnabled()) { |
| 751 WebGestureEvent scaledEvent = event; | 751 WebGestureEvent scaledEvent = event; |
| (...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3275 if (TextAutosizer* textAutosizer = frame->document()->textAutosizer()) | 3275 if (TextAutosizer* textAutosizer = frame->document()->textAutosizer()) |
| 3276 textAutosizer->updatePageInfoInAllFrames(); | 3276 textAutosizer->updatePageInfoInAllFrames(); |
| 3277 } | 3277 } |
| 3278 } | 3278 } |
| 3279 | 3279 |
| 3280 void WebViewImpl::updateMainFrameLayoutSize() | 3280 void WebViewImpl::updateMainFrameLayoutSize() |
| 3281 { | 3281 { |
| 3282 if (m_shouldAutoResize || !mainFrameImpl()) | 3282 if (m_shouldAutoResize || !mainFrameImpl()) |
| 3283 return; | 3283 return; |
| 3284 | 3284 |
| 3285 RefPtr<FrameView> view = mainFrameImpl()->frameView(); | 3285 RefPtrWillBeRawPtr<FrameView> view = mainFrameImpl()->frameView(); |
| 3286 if (!view) | 3286 if (!view) |
| 3287 return; | 3287 return; |
| 3288 | 3288 |
| 3289 WebSize layoutSize = m_size; | 3289 WebSize layoutSize = m_size; |
| 3290 | 3290 |
| 3291 if (settings()->viewportEnabled()) | 3291 if (settings()->viewportEnabled()) |
| 3292 layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedConstra
ints().layoutSize); | 3292 layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedConstra
ints().layoutSize); |
| 3293 | 3293 |
| 3294 if (page()->settings().forceZeroLayoutHeight()) | 3294 if (page()->settings().forceZeroLayoutHeight()) |
| 3295 layoutSize.height = 0; | 3295 layoutSize.height = 0; |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4444 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4444 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4445 | 4445 |
| 4446 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4446 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4447 return false; | 4447 return false; |
| 4448 | 4448 |
| 4449 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4449 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4450 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4450 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4451 } | 4451 } |
| 4452 | 4452 |
| 4453 } // namespace blink | 4453 } // namespace blink |
| OLD | NEW |