| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "web/RemoteFrameClientImpl.h" | 6 #include "web/RemoteFrameClientImpl.h" |
| 7 | 7 |
| 8 #include "core/events/KeyboardEvent.h" | 8 #include "core/events/KeyboardEvent.h" |
| 9 #include "core/events/MouseEvent.h" | 9 #include "core/events/MouseEvent.h" |
| 10 #include "core/events/WheelEvent.h" | 10 #include "core/events/WheelEvent.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (m_webFrame->client()) | 103 if (m_webFrame->client()) |
| 104 m_webFrame->client()->navigate(WrappedResourceRequest(request), shouldRe
placeCurrentEntry); | 104 m_webFrame->client()->navigate(WrappedResourceRequest(request), shouldRe
placeCurrentEntry); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void RemoteFrameClientImpl::reload(FrameLoadType loadType, ClientRedirectPolicy
clientRedirectPolicy) | 107 void RemoteFrameClientImpl::reload(FrameLoadType loadType, ClientRedirectPolicy
clientRedirectPolicy) |
| 108 { | 108 { |
| 109 if (m_webFrame->client()) | 109 if (m_webFrame->client()) |
| 110 m_webFrame->client()->reload(loadType == FrameLoadTypeReloadFromOrigin,
clientRedirectPolicy == ClientRedirect); | 110 m_webFrame->client()->reload(loadType == FrameLoadTypeReloadFromOrigin,
clientRedirectPolicy == ClientRedirect); |
| 111 } | 111 } |
| 112 | 112 |
| 113 unsigned RemoteFrameClientImpl::backForwardLength() |
| 114 { |
| 115 // TODO(creis,japhet): This method should return the real value for the |
| 116 // session history length. For now, return static value for the initial |
| 117 // navigation and the subsequent one moving the frame out-of-process. |
| 118 // See https://crbug.com/501116. |
| 119 return 2; |
| 120 } |
| 121 |
| 113 // FIXME: Remove this code once we have input routing in the browser | 122 // FIXME: Remove this code once we have input routing in the browser |
| 114 // process. See http://crbug.com/339659. | 123 // process. See http://crbug.com/339659. |
| 115 void RemoteFrameClientImpl::forwardInputEvent(Event* event) | 124 void RemoteFrameClientImpl::forwardInputEvent(Event* event) |
| 116 { | 125 { |
| 117 // This is only called when we have out-of-process iframes, which | 126 // This is only called when we have out-of-process iframes, which |
| 118 // need to forward input events across processes. | 127 // need to forward input events across processes. |
| 119 // FIXME: Add a check for out-of-process iframes enabled. | 128 // FIXME: Add a check for out-of-process iframes enabled. |
| 120 OwnPtr<WebInputEvent> webEvent; | 129 OwnPtr<WebInputEvent> webEvent; |
| 121 if (event->isKeyboardEvent()) | 130 if (event->isKeyboardEvent()) |
| 122 webEvent = adoptPtr(new WebKeyboardEventBuilder(*static_cast<KeyboardEve
nt*>(event))); | 131 webEvent = adoptPtr(new WebKeyboardEventBuilder(*static_cast<KeyboardEve
nt*>(event))); |
| 123 else if (event->isMouseEvent()) | 132 else if (event->isMouseEvent()) |
| 124 webEvent = adoptPtr(new WebMouseEventBuilder(m_webFrame->frame()->view()
, toCoreFrame(m_webFrame)->ownerLayoutObject(), *static_cast<MouseEvent*>(event)
)); | 133 webEvent = adoptPtr(new WebMouseEventBuilder(m_webFrame->frame()->view()
, toCoreFrame(m_webFrame)->ownerLayoutObject(), *static_cast<MouseEvent*>(event)
)); |
| 125 else if (event->isWheelEvent()) | 134 else if (event->isWheelEvent()) |
| 126 webEvent = adoptPtr(new WebMouseWheelEventBuilder(m_webFrame->frame()->v
iew(), toCoreFrame(m_webFrame)->ownerLayoutObject(), *static_cast<WheelEvent*>(e
vent))); | 135 webEvent = adoptPtr(new WebMouseWheelEventBuilder(m_webFrame->frame()->v
iew(), toCoreFrame(m_webFrame)->ownerLayoutObject(), *static_cast<WheelEvent*>(e
vent))); |
| 127 | 136 |
| 128 // Other or internal Blink events should not be forwarded. | 137 // Other or internal Blink events should not be forwarded. |
| 129 if (!webEvent || webEvent->type == WebInputEvent::Undefined) | 138 if (!webEvent || webEvent->type == WebInputEvent::Undefined) |
| 130 return; | 139 return; |
| 131 | 140 |
| 132 m_webFrame->client()->forwardInputEvent(webEvent.get()); | 141 m_webFrame->client()->forwardInputEvent(webEvent.get()); |
| 133 } | 142 } |
| 134 | 143 |
| 135 } // namespace blink | 144 } // namespace blink |
| OLD | NEW |