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 3480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3491 if (!page()) | 3491 if (!page()) |
3492 return; | 3492 return; |
3493 | 3493 |
3494 page()->contextMenuController().clearContextMenu(); | 3494 page()->contextMenuController().clearContextMenu(); |
3495 m_contextMenuAllowed = true; | 3495 m_contextMenuAllowed = true; |
3496 if (LocalFrame* focusedFrame = toLocalFrame(page()->focusController().focuse
dOrMainFrame())) | 3496 if (LocalFrame* focusedFrame = toLocalFrame(page()->focusController().focuse
dOrMainFrame())) |
3497 focusedFrame->eventHandler().sendContextMenuEventForKey(); | 3497 focusedFrame->eventHandler().sendContextMenuEventForKey(); |
3498 m_contextMenuAllowed = false; | 3498 m_contextMenuAllowed = false; |
3499 } | 3499 } |
3500 | 3500 |
| 3501 // FIXME: This should be removed when the chromium side patch lands |
| 3502 // http://codereview.chromium.org/260623004 |
3501 WebString WebViewImpl::getSmartClipData(WebRect rect) | 3503 WebString WebViewImpl::getSmartClipData(WebRect rect) |
3502 { | 3504 { |
| 3505 return WebString(); |
| 3506 } |
| 3507 |
| 3508 void WebViewImpl::getSmartClipData(WebRect rect, WebString& clipText, WebRect& c
lipRect) |
| 3509 { |
3503 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); | 3510 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); |
3504 if (!frame) | 3511 if (!frame) |
3505 return WebString(); | 3512 return; |
3506 return WebCore::SmartClip(frame).dataForRect(rect).toString(); | 3513 SmartClipData clipData = WebCore::SmartClip(frame).dataForRect(rect); |
| 3514 clipText = clipData.clipData(); |
| 3515 clipRect = clipData.rect(); |
3507 } | 3516 } |
3508 | 3517 |
3509 void WebViewImpl::hidePopups() | 3518 void WebViewImpl::hidePopups() |
3510 { | 3519 { |
3511 hideSelectPopup(); | 3520 hideSelectPopup(); |
3512 if (m_pagePopup) | 3521 if (m_pagePopup) |
3513 closePagePopup(m_pagePopup.get()); | 3522 closePagePopup(m_pagePopup.get()); |
3514 } | 3523 } |
3515 | 3524 |
3516 void WebViewImpl::setIsTransparent(bool isTransparent) | 3525 void WebViewImpl::setIsTransparent(bool isTransparent) |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4151 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4160 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4152 | 4161 |
4153 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4162 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4154 return false; | 4163 return false; |
4155 | 4164 |
4156 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4165 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4157 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4166 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4158 } | 4167 } |
4159 | 4168 |
4160 } // namespace blink | 4169 } // namespace blink |
OLD | NEW |