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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // FIXME: Use targeted event here and save another hit test. | 736 // FIXME: Use targeted event here and save another hit test. |
737 // FIXME: Content intent should be generated using same node that was hi
ghlighted. crbug.com/416746 | 737 // FIXME: Content intent should be generated using same node that was hi
ghlighted. crbug.com/416746 |
738 if (detectContentOnTouch(platformEvent.position())) { | 738 if (detectContentOnTouch(platformEvent.position())) { |
739 eventSwallowed = true; | 739 eventSwallowed = true; |
740 break; | 740 break; |
741 } | 741 } |
742 | 742 |
743 RefPtr<PopupContainer> selectPopup; | 743 RefPtrWillBeRawPtr<PopupContainer> selectPopup = nullptr; |
744 selectPopup = m_selectPopup; | 744 selectPopup = m_selectPopup; |
745 hideSelectPopup(); | 745 hideSelectPopup(); |
746 ASSERT(!m_selectPopup); | 746 ASSERT(!m_selectPopup); |
747 | 747 |
748 // Don't trigger a disambiguation popup on sites designed for mobile dev
ices. | 748 // Don't trigger a disambiguation popup on sites designed for mobile dev
ices. |
749 // Instead, assume that the page has been designed with big enough butto
ns and links. | 749 // Instead, assume that the page has been designed with big enough butto
ns and links. |
750 // Don't trigger a disambiguation popup when screencasting, since it's i
mplemented outside of | 750 // Don't trigger a disambiguation popup when screencasting, since it's i
mplemented outside of |
751 // compositor pipeline and is not being screencasted itself. This leads
to bad user experience. | 751 // compositor pipeline and is not being screencasted itself. This leads
to bad user experience. |
752 if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds() && !p
age()->inspectorController().screencastEnabled()) { | 752 if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds() && !p
age()->inspectorController().screencastEnabled()) { |
753 WebGestureEvent scaledEvent = event; | 753 WebGestureEvent scaledEvent = event; |
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3253 if (TextAutosizer* textAutosizer = frame->document()->textAutosizer()) | 3253 if (TextAutosizer* textAutosizer = frame->document()->textAutosizer()) |
3254 textAutosizer->updatePageInfoInAllFrames(); | 3254 textAutosizer->updatePageInfoInAllFrames(); |
3255 } | 3255 } |
3256 } | 3256 } |
3257 | 3257 |
3258 void WebViewImpl::updateMainFrameLayoutSize() | 3258 void WebViewImpl::updateMainFrameLayoutSize() |
3259 { | 3259 { |
3260 if (m_shouldAutoResize || !mainFrameImpl()) | 3260 if (m_shouldAutoResize || !mainFrameImpl()) |
3261 return; | 3261 return; |
3262 | 3262 |
3263 RefPtr<FrameView> view = mainFrameImpl()->frameView(); | 3263 RefPtrWillBeRawPtr<FrameView> view = mainFrameImpl()->frameView(); |
3264 if (!view) | 3264 if (!view) |
3265 return; | 3265 return; |
3266 | 3266 |
3267 WebSize layoutSize = m_size; | 3267 WebSize layoutSize = m_size; |
3268 | 3268 |
3269 if (settings()->viewportEnabled()) | 3269 if (settings()->viewportEnabled()) |
3270 layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedConstra
ints().layoutSize); | 3270 layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedConstra
ints().layoutSize); |
3271 | 3271 |
3272 if (page()->settings().forceZeroLayoutHeight()) | 3272 if (page()->settings().forceZeroLayoutHeight()) |
3273 layoutSize.height = 0; | 3273 layoutSize.height = 0; |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4414 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4414 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4415 | 4415 |
4416 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4416 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4417 return false; | 4417 return false; |
4418 | 4418 |
4419 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4419 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4420 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4420 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4421 } | 4421 } |
4422 | 4422 |
4423 } // namespace blink | 4423 } // namespace blink |
OLD | NEW |