OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1883 // clears the text box. So it's important this happens after the event | 1883 // clears the text box. So it's important this happens after the event |
1884 // handlers have been fired. | 1884 // handlers have been fired. |
1885 #if PLATFORM(GTK) | 1885 #if PLATFORM(GTK) |
1886 if (mouseEvent.type() != PlatformEvent::MousePressed) | 1886 if (mouseEvent.type() != PlatformEvent::MousePressed) |
1887 return false; | 1887 return false; |
1888 #else | 1888 #else |
1889 if (mouseEvent.type() != PlatformEvent::MouseReleased) | 1889 if (mouseEvent.type() != PlatformEvent::MouseReleased) |
1890 return false; | 1890 return false; |
1891 #endif | 1891 #endif |
1892 | 1892 |
| 1893 if (!m_frame->page()) |
| 1894 return false; |
1893 Frame* focusFrame = m_frame->page()->focusController()->focusedOrMainFrame()
; | 1895 Frame* focusFrame = m_frame->page()->focusController()->focusedOrMainFrame()
; |
1894 // Do not paste here if the focus was moved somewhere else. | 1896 // Do not paste here if the focus was moved somewhere else. |
1895 if (m_frame == focusFrame && m_frame->editor()->client()->supportsGlobalSele
ction()) | 1897 if (m_frame == focusFrame && m_frame->editor()->client()->supportsGlobalSele
ction()) |
1896 return m_frame->editor()->command(ASCIILiteral("PasteGlobalSelection")).
execute(); | 1898 return m_frame->editor()->command(ASCIILiteral("PasteGlobalSelection")).
execute(); |
1897 | 1899 |
1898 return false; | 1900 return false; |
1899 } | 1901 } |
1900 | 1902 |
1901 | 1903 |
1902 #if ENABLE(DRAG_SUPPORT) | 1904 #if ENABLE(DRAG_SUPPORT) |
(...skipping 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4023 #endif | 4025 #endif |
4024 | 4026 |
4025 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) | 4027 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) |
4026 { | 4028 { |
4027 m_mousePositionIsUnknown = false; | 4029 m_mousePositionIsUnknown = false; |
4028 m_lastKnownMousePosition = event.position(); | 4030 m_lastKnownMousePosition = event.position(); |
4029 m_lastKnownMouseGlobalPosition = event.globalPosition(); | 4031 m_lastKnownMouseGlobalPosition = event.globalPosition(); |
4030 } | 4032 } |
4031 | 4033 |
4032 } // namespace WebCore | 4034 } // namespace WebCore |
OLD | NEW |