| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #include "platform/wtf/PtrUtil.h" | 60 #include "platform/wtf/PtrUtil.h" |
| 61 #include "public/web/WebAutofillClient.h" | 61 #include "public/web/WebAutofillClient.h" |
| 62 #include "public/web/WebPlugin.h" | 62 #include "public/web/WebPlugin.h" |
| 63 #include "public/web/WebRange.h" | 63 #include "public/web/WebRange.h" |
| 64 #include "public/web/WebWidgetClient.h" | 64 #include "public/web/WebWidgetClient.h" |
| 65 #include "web/AnimationWorkletProxyClientImpl.h" | 65 #include "web/AnimationWorkletProxyClientImpl.h" |
| 66 #include "web/CompositionUnderlineVectorBuilder.h" | 66 #include "web/CompositionUnderlineVectorBuilder.h" |
| 67 #include "web/CompositorMutatorImpl.h" | 67 #include "web/CompositorMutatorImpl.h" |
| 68 #include "web/CompositorWorkerProxyClientImpl.h" | 68 #include "web/CompositorWorkerProxyClientImpl.h" |
| 69 #include "web/ContextMenuAllowedScope.h" | 69 #include "web/ContextMenuAllowedScope.h" |
| 70 #include "web/InspectorOverlayAgent.h" | 70 #include "web/InspectorOverlay.h" |
| 71 #include "web/PageOverlay.h" | 71 #include "web/PageOverlay.h" |
| 72 #include "web/WebDevToolsAgentImpl.h" | 72 #include "web/WebDevToolsAgentImpl.h" |
| 73 #include "web/WebInputEventConversion.h" | 73 #include "web/WebInputEventConversion.h" |
| 74 #include "web/WebInputMethodControllerImpl.h" | 74 #include "web/WebInputMethodControllerImpl.h" |
| 75 #include "web/WebLocalFrameImpl.h" | 75 #include "web/WebLocalFrameImpl.h" |
| 76 #include "web/WebPluginContainerImpl.h" | 76 #include "web/WebPluginContainerImpl.h" |
| 77 #include "web/WebRemoteFrameImpl.h" | 77 #include "web/WebRemoteFrameImpl.h" |
| 78 #include "web/WebViewFrameWidget.h" | 78 #include "web/WebViewFrameWidget.h" |
| 79 | 79 |
| 80 namespace blink { | 80 namespace blink { |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 last_frame_time_monotonic); | 243 last_frame_time_monotonic); |
| 244 DCHECK(last_frame_time_monotonic); | 244 DCHECK(last_frame_time_monotonic); |
| 245 PageWidgetDelegate::Animate(*GetPage(), last_frame_time_monotonic); | 245 PageWidgetDelegate::Animate(*GetPage(), last_frame_time_monotonic); |
| 246 } | 246 } |
| 247 | 247 |
| 248 void WebFrameWidgetImpl::UpdateAllLifecyclePhases() { | 248 void WebFrameWidgetImpl::UpdateAllLifecyclePhases() { |
| 249 TRACE_EVENT0("blink", "WebFrameWidgetImpl::updateAllLifecyclePhases"); | 249 TRACE_EVENT0("blink", "WebFrameWidgetImpl::updateAllLifecyclePhases"); |
| 250 if (!local_root_) | 250 if (!local_root_) |
| 251 return; | 251 return; |
| 252 | 252 |
| 253 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) { | 253 if (InspectorOverlay* overlay = GetInspectorOverlay()) { |
| 254 overlay->UpdateAllLifecyclePhases(); | 254 overlay->UpdateAllLifecyclePhases(); |
| 255 // TODO(chrishtr): integrate paint into the overlay's lifecycle. | 255 // TODO(chrishtr): integrate paint into the overlay's lifecycle. |
| 256 if (overlay->GetPageOverlay() && | 256 if (overlay->GetPageOverlay() && |
| 257 overlay->GetPageOverlay()->GetGraphicsLayer()) | 257 overlay->GetPageOverlay()->GetGraphicsLayer()) |
| 258 overlay->GetPageOverlay()->GetGraphicsLayer()->Paint(nullptr); | 258 overlay->GetPageOverlay()->GetGraphicsLayer()->Paint(nullptr); |
| 259 } | 259 } |
| 260 PageWidgetDelegate::UpdateAllLifecyclePhases(*GetPage(), | 260 PageWidgetDelegate::UpdateAllLifecyclePhases(*GetPage(), |
| 261 *local_root_->GetFrame()); | 261 *local_root_->GetFrame()); |
| 262 UpdateLayerTreeBackgroundColor(); | 262 UpdateLayerTreeBackgroundColor(); |
| 263 } | 263 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 WebInputEvent::GetName(input_event.GetType())); | 355 WebInputEvent::GetName(input_event.GetType())); |
| 356 | 356 |
| 357 // If a drag-and-drop operation is in progress, ignore input events. | 357 // If a drag-and-drop operation is in progress, ignore input events. |
| 358 if (doing_drag_and_drop_) | 358 if (doing_drag_and_drop_) |
| 359 return WebInputEventResult::kHandledSuppressed; | 359 return WebInputEventResult::kHandledSuppressed; |
| 360 | 360 |
| 361 // Don't handle events once we've started shutting down. | 361 // Don't handle events once we've started shutting down. |
| 362 if (!GetPage()) | 362 if (!GetPage()) |
| 363 return WebInputEventResult::kNotHandled; | 363 return WebInputEventResult::kNotHandled; |
| 364 | 364 |
| 365 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) { | 365 if (InspectorOverlay* overlay = GetInspectorOverlay()) { |
| 366 if (overlay->HandleInputEvent(input_event)) | 366 if (overlay->HandleInputEvent(input_event)) |
| 367 return WebInputEventResult::kHandledSuppressed; | 367 return WebInputEventResult::kHandledSuppressed; |
| 368 } | 368 } |
| 369 | 369 |
| 370 // Report the event to be NOT processed by WebKit, so that the browser can | 370 // Report the event to be NOT processed by WebKit, so that the browser can |
| 371 // handle it appropriately. | 371 // handle it appropriately. |
| 372 if (IgnoreInputEvents()) | 372 if (IgnoreInputEvents()) |
| 373 return WebInputEventResult::kNotHandled; | 373 return WebInputEventResult::kNotHandled; |
| 374 | 374 |
| 375 // FIXME: pass event to m_localRoot's WebDevToolsAgentImpl once available. | 375 // FIXME: pass event to m_localRoot's WebDevToolsAgentImpl once available. |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 const IntPoint& pos_in_root_frame) { | 1147 const IntPoint& pos_in_root_frame) { |
| 1148 IntPoint doc_point( | 1148 IntPoint doc_point( |
| 1149 local_root_->GetFrame()->View()->RootFrameToContents(pos_in_root_frame)); | 1149 local_root_->GetFrame()->View()->RootFrameToContents(pos_in_root_frame)); |
| 1150 HitTestResult result = | 1150 HitTestResult result = |
| 1151 local_root_->GetFrame()->GetEventHandler().HitTestResultAtPoint( | 1151 local_root_->GetFrame()->GetEventHandler().HitTestResultAtPoint( |
| 1152 doc_point, HitTestRequest::kReadOnly | HitTestRequest::kActive); | 1152 doc_point, HitTestRequest::kReadOnly | HitTestRequest::kActive); |
| 1153 result.SetToShadowHostIfInRestrictedShadowRoot(); | 1153 result.SetToShadowHostIfInRestrictedShadowRoot(); |
| 1154 return result; | 1154 return result; |
| 1155 } | 1155 } |
| 1156 | 1156 |
| 1157 InspectorOverlayAgent* WebFrameWidgetImpl::GetInspectorOverlay() { | 1157 InspectorOverlay* WebFrameWidgetImpl::GetInspectorOverlay() { |
| 1158 if (!local_root_) | 1158 if (!local_root_) |
| 1159 return nullptr; | 1159 return nullptr; |
| 1160 if (WebDevToolsAgentImpl* devtools = local_root_->DevToolsAgentImpl()) | 1160 if (WebDevToolsAgentImpl* devtools = local_root_->DevToolsAgentImpl()) |
| 1161 return devtools->OverlayAgent(); | 1161 return devtools->Overlay(); |
| 1162 return nullptr; | 1162 return nullptr; |
| 1163 } | 1163 } |
| 1164 | 1164 |
| 1165 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameInWidget() const { | 1165 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameInWidget() const { |
| 1166 LocalFrame* frame = GetPage()->GetFocusController().FocusedFrame(); | 1166 LocalFrame* frame = GetPage()->GetFocusController().FocusedFrame(); |
| 1167 return (frame && frame->LocalFrameRoot() == local_root_->GetFrame()) | 1167 return (frame && frame->LocalFrameRoot() == local_root_->GetFrame()) |
| 1168 ? frame | 1168 ? frame |
| 1169 : nullptr; | 1169 : nullptr; |
| 1170 } | 1170 } |
| 1171 | 1171 |
| 1172 WebPlugin* WebFrameWidgetImpl::FocusedPluginIfInputMethodSupported( | 1172 WebPlugin* WebFrameWidgetImpl::FocusedPluginIfInputMethodSupported( |
| 1173 LocalFrame* frame) const { | 1173 LocalFrame* frame) const { |
| 1174 WebPluginContainerImpl* container = | 1174 WebPluginContainerImpl* container = |
| 1175 WebLocalFrameImpl::CurrentPluginContainer(frame); | 1175 WebLocalFrameImpl::CurrentPluginContainer(frame); |
| 1176 if (container && container->SupportsInputMethod()) | 1176 if (container && container->SupportsInputMethod()) |
| 1177 return container->Plugin(); | 1177 return container->Plugin(); |
| 1178 return nullptr; | 1178 return nullptr; |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameAvailableForIme() const { | 1181 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameAvailableForIme() const { |
| 1182 if (!ime_accept_events_) | 1182 if (!ime_accept_events_) |
| 1183 return nullptr; | 1183 return nullptr; |
| 1184 return FocusedLocalFrameInWidget(); | 1184 return FocusedLocalFrameInWidget(); |
| 1185 } | 1185 } |
| 1186 | 1186 |
| 1187 } // namespace blink | 1187 } // namespace blink |
| OLD | NEW |