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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 #include "weborigin/SchemeRegistry.h" | 162 #include "weborigin/SchemeRegistry.h" |
163 #include "weborigin/SecurityOrigin.h" | 163 #include "weborigin/SecurityOrigin.h" |
164 #include "weborigin/SecurityPolicy.h" | 164 #include "weborigin/SecurityPolicy.h" |
165 #include "painting/ContinuousPainter.h" | 165 #include "painting/ContinuousPainter.h" |
166 | 166 |
167 #if ENABLE(DEFAULT_RENDER_THEME) | 167 #if ENABLE(DEFAULT_RENDER_THEME) |
168 #include "core/platform/chromium/PlatformThemeChromiumDefault.h" | 168 #include "core/platform/chromium/PlatformThemeChromiumDefault.h" |
169 #include "core/rendering/RenderThemeChromiumDefault.h" | 169 #include "core/rendering/RenderThemeChromiumDefault.h" |
170 #endif | 170 #endif |
171 | 171 |
172 #if OS(WINDOWS) | 172 #if OS(WIN) |
173 #if !ENABLE(DEFAULT_RENDER_THEME) | 173 #if !ENABLE(DEFAULT_RENDER_THEME) |
174 #include "core/rendering/RenderThemeChromiumWin.h" | 174 #include "core/rendering/RenderThemeChromiumWin.h" |
175 #endif | 175 #endif |
176 #else | 176 #else |
177 #include "core/rendering/RenderTheme.h" | 177 #include "core/rendering/RenderTheme.h" |
178 #endif | 178 #endif |
179 | 179 |
180 // Get rid of WTF's pow define so we can use std::pow. | 180 // Get rid of WTF's pow define so we can use std::pow. |
181 #undef pow | 181 #undef pow |
182 #include <cmath> // for std::pow | 182 #include <cmath> // for std::pow |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 PlatformMouseEventBuilder pme(mainFrameImpl()->frameView(), event); | 574 PlatformMouseEventBuilder pme(mainFrameImpl()->frameView(), event); |
575 | 575 |
576 // Find the right target frame. See issue 1186900. | 576 // Find the right target frame. See issue 1186900. |
577 HitTestResult result = hitTestResultForWindowPos(pme.position()); | 577 HitTestResult result = hitTestResultForWindowPos(pme.position()); |
578 Frame* targetFrame; | 578 Frame* targetFrame; |
579 if (result.innerNonSharedNode()) | 579 if (result.innerNonSharedNode()) |
580 targetFrame = result.innerNonSharedNode()->document().frame(); | 580 targetFrame = result.innerNonSharedNode()->document().frame(); |
581 else | 581 else |
582 targetFrame = m_page->focusController().focusedOrMainFrame(); | 582 targetFrame = m_page->focusController().focusedOrMainFrame(); |
583 | 583 |
584 #if OS(WINDOWS) | 584 #if OS(WIN) |
585 targetFrame->view()->setCursor(pointerCursor()); | 585 targetFrame->view()->setCursor(pointerCursor()); |
586 #endif | 586 #endif |
587 | 587 |
588 m_contextMenuAllowed = true; | 588 m_contextMenuAllowed = true; |
589 targetFrame->eventHandler()->sendContextMenuEvent(pme); | 589 targetFrame->eventHandler()->sendContextMenuEvent(pme); |
590 m_contextMenuAllowed = false; | 590 m_contextMenuAllowed = false; |
591 // Actually showing the context menu is handled by the ContextMenuClient | 591 // Actually showing the context menu is handled by the ContextMenuClient |
592 // implementation... | 592 // implementation... |
593 } | 593 } |
594 | 594 |
595 void WebViewImpl::handleMouseUp(Frame& mainFrame, const WebMouseEvent& event) | 595 void WebViewImpl::handleMouseUp(Frame& mainFrame, const WebMouseEvent& event) |
596 { | 596 { |
597 PageWidgetEventHandler::handleMouseUp(mainFrame, event); | 597 PageWidgetEventHandler::handleMouseUp(mainFrame, event); |
598 | 598 |
599 #if OS(WINDOWS) | 599 #if OS(WIN) |
600 // Dispatch the contextmenu event regardless of if the click was swallowed. | 600 // Dispatch the contextmenu event regardless of if the click was swallowed. |
601 // On Mac/Linux, we handle it on mouse down, not up. | 601 // On Mac/Linux, we handle it on mouse down, not up. |
602 if (event.button == WebMouseEvent::ButtonRight) | 602 if (event.button == WebMouseEvent::ButtonRight) |
603 mouseContextMenu(event); | 603 mouseContextMenu(event); |
604 #endif | 604 #endif |
605 } | 605 } |
606 | 606 |
607 bool WebViewImpl::handleMouseWheel(Frame& mainFrame, const WebMouseWheelEvent& e
vent) | 607 bool WebViewImpl::handleMouseWheel(Frame& mainFrame, const WebMouseWheelEvent& e
vent) |
608 { | 608 { |
609 hidePopups(); | 609 hidePopups(); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 RefPtr<Frame> frame = focusedWebCoreFrame(); | 928 RefPtr<Frame> frame = focusedWebCoreFrame(); |
929 if (!frame) | 929 if (!frame) |
930 return false; | 930 return false; |
931 | 931 |
932 EventHandler* handler = frame->eventHandler(); | 932 EventHandler* handler = frame->eventHandler(); |
933 if (!handler) | 933 if (!handler) |
934 return keyEventDefault(event); | 934 return keyEventDefault(event); |
935 | 935 |
936 #if !OS(MACOSX) | 936 #if !OS(MACOSX) |
937 const WebInputEvent::Type contextMenuTriggeringEventType = | 937 const WebInputEvent::Type contextMenuTriggeringEventType = |
938 #if OS(WINDOWS) | 938 #if OS(WIN) |
939 WebInputEvent::KeyUp; | 939 WebInputEvent::KeyUp; |
940 #elif OS(UNIX) | 940 #elif OS(UNIX) |
941 WebInputEvent::RawKeyDown; | 941 WebInputEvent::RawKeyDown; |
942 #endif | 942 #endif |
943 | 943 |
944 bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers
) && event.windowsKeyCode == VKEY_APPS; | 944 bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers
) && event.windowsKeyCode == VKEY_APPS; |
945 bool isShiftF10 = event.modifiers == WebInputEvent::ShiftKey && event.window
sKeyCode == VKEY_F10; | 945 bool isShiftF10 = event.modifiers == WebInputEvent::ShiftKey && event.window
sKeyCode == VKEY_F10; |
946 if ((isUnmodifiedMenuKey || isShiftF10) && event.type == contextMenuTriggeri
ngEventType) { | 946 if ((isUnmodifiedMenuKey || isShiftF10) && event.type == contextMenuTriggeri
ngEventType) { |
947 sendContextMenuEvent(event); | 947 sendContextMenuEvent(event); |
948 return true; | 948 return true; |
(...skipping 3165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4114 // the initial viewport width. | 4114 // the initial viewport width. |
4115 // 2. The author has disabled viewport zoom. | 4115 // 2. The author has disabled viewport zoom. |
4116 | 4116 |
4117 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4117 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4118 | 4118 |
4119 return fixedLayoutSize().width == m_size.width | 4119 return fixedLayoutSize().width == m_size.width |
4120 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4120 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4121 } | 4121 } |
4122 | 4122 |
4123 } // namespace WebKit | 4123 } // namespace WebKit |
OLD | NEW |