Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 2819183002: [DevTools] Consolidate overlay-related functionality in Overlay domain (Closed)
Patch Set: rebased bad merge Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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/InspectorOverlay.h" 70 #include "web/InspectorOverlayAgent.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/WebPagePopupImpl.h" 76 #include "web/WebPagePopupImpl.h"
77 #include "web/WebPluginContainerImpl.h" 77 #include "web/WebPluginContainerImpl.h"
78 #include "web/WebRemoteFrameImpl.h" 78 #include "web/WebRemoteFrameImpl.h"
79 #include "web/WebViewFrameWidget.h" 79 #include "web/WebViewFrameWidget.h"
80 80
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 last_frame_time_monotonic); 244 last_frame_time_monotonic);
245 DCHECK(last_frame_time_monotonic); 245 DCHECK(last_frame_time_monotonic);
246 PageWidgetDelegate::Animate(*GetPage(), last_frame_time_monotonic); 246 PageWidgetDelegate::Animate(*GetPage(), last_frame_time_monotonic);
247 } 247 }
248 248
249 void WebFrameWidgetImpl::UpdateAllLifecyclePhases() { 249 void WebFrameWidgetImpl::UpdateAllLifecyclePhases() {
250 TRACE_EVENT0("blink", "WebFrameWidgetImpl::updateAllLifecyclePhases"); 250 TRACE_EVENT0("blink", "WebFrameWidgetImpl::updateAllLifecyclePhases");
251 if (!local_root_) 251 if (!local_root_)
252 return; 252 return;
253 253
254 if (InspectorOverlay* overlay = GetInspectorOverlay()) { 254 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) {
255 overlay->UpdateAllLifecyclePhases(); 255 overlay->UpdateAllLifecyclePhases();
256 // TODO(chrishtr): integrate paint into the overlay's lifecycle. 256 // TODO(chrishtr): integrate paint into the overlay's lifecycle.
257 if (overlay->GetPageOverlay() && 257 if (overlay->GetPageOverlay() &&
258 overlay->GetPageOverlay()->GetGraphicsLayer()) 258 overlay->GetPageOverlay()->GetGraphicsLayer())
259 overlay->GetPageOverlay()->GetGraphicsLayer()->Paint(nullptr); 259 overlay->GetPageOverlay()->GetGraphicsLayer()->Paint(nullptr);
260 } 260 }
261 PageWidgetDelegate::UpdateAllLifecyclePhases(*GetPage(), 261 PageWidgetDelegate::UpdateAllLifecyclePhases(*GetPage(),
262 *local_root_->GetFrame()); 262 *local_root_->GetFrame());
263 UpdateLayerTreeBackgroundColor(); 263 UpdateLayerTreeBackgroundColor();
264 } 264 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 WebInputEvent::GetName(input_event.GetType())); 356 WebInputEvent::GetName(input_event.GetType()));
357 357
358 // If a drag-and-drop operation is in progress, ignore input events. 358 // If a drag-and-drop operation is in progress, ignore input events.
359 if (doing_drag_and_drop_) 359 if (doing_drag_and_drop_)
360 return WebInputEventResult::kHandledSuppressed; 360 return WebInputEventResult::kHandledSuppressed;
361 361
362 // Don't handle events once we've started shutting down. 362 // Don't handle events once we've started shutting down.
363 if (!GetPage()) 363 if (!GetPage())
364 return WebInputEventResult::kNotHandled; 364 return WebInputEventResult::kNotHandled;
365 365
366 if (InspectorOverlay* overlay = GetInspectorOverlay()) { 366 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) {
367 if (overlay->HandleInputEvent(input_event)) 367 if (overlay->HandleInputEvent(input_event))
368 return WebInputEventResult::kHandledSuppressed; 368 return WebInputEventResult::kHandledSuppressed;
369 } 369 }
370 370
371 // Report the event to be NOT processed by WebKit, so that the browser can 371 // Report the event to be NOT processed by WebKit, so that the browser can
372 // handle it appropriately. 372 // handle it appropriately.
373 if (IgnoreInputEvents()) 373 if (IgnoreInputEvents())
374 return WebInputEventResult::kNotHandled; 374 return WebInputEventResult::kNotHandled;
375 375
376 // FIXME: pass event to m_localRoot's WebDevToolsAgentImpl once available. 376 // FIXME: pass event to m_localRoot's WebDevToolsAgentImpl once available.
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 const IntPoint& pos_in_root_frame) { 1174 const IntPoint& pos_in_root_frame) {
1175 IntPoint doc_point( 1175 IntPoint doc_point(
1176 local_root_->GetFrame()->View()->RootFrameToContents(pos_in_root_frame)); 1176 local_root_->GetFrame()->View()->RootFrameToContents(pos_in_root_frame));
1177 HitTestResult result = 1177 HitTestResult result =
1178 local_root_->GetFrame()->GetEventHandler().HitTestResultAtPoint( 1178 local_root_->GetFrame()->GetEventHandler().HitTestResultAtPoint(
1179 doc_point, HitTestRequest::kReadOnly | HitTestRequest::kActive); 1179 doc_point, HitTestRequest::kReadOnly | HitTestRequest::kActive);
1180 result.SetToShadowHostIfInRestrictedShadowRoot(); 1180 result.SetToShadowHostIfInRestrictedShadowRoot();
1181 return result; 1181 return result;
1182 } 1182 }
1183 1183
1184 InspectorOverlay* WebFrameWidgetImpl::GetInspectorOverlay() { 1184 InspectorOverlayAgent* WebFrameWidgetImpl::GetInspectorOverlay() {
1185 if (!local_root_) 1185 if (!local_root_)
1186 return nullptr; 1186 return nullptr;
1187 if (WebDevToolsAgentImpl* devtools = local_root_->DevToolsAgentImpl()) 1187 if (WebDevToolsAgentImpl* devtools = local_root_->DevToolsAgentImpl())
1188 return devtools->Overlay(); 1188 return devtools->OverlayAgent();
1189 return nullptr; 1189 return nullptr;
1190 } 1190 }
1191 1191
1192 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameInWidget() const { 1192 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameInWidget() const {
1193 LocalFrame* frame = GetPage()->GetFocusController().FocusedFrame(); 1193 LocalFrame* frame = GetPage()->GetFocusController().FocusedFrame();
1194 return (frame && frame->LocalFrameRoot() == local_root_->GetFrame()) 1194 return (frame && frame->LocalFrameRoot() == local_root_->GetFrame())
1195 ? frame 1195 ? frame
1196 : nullptr; 1196 : nullptr;
1197 } 1197 }
1198 1198
1199 WebPlugin* WebFrameWidgetImpl::FocusedPluginIfInputMethodSupported( 1199 WebPlugin* WebFrameWidgetImpl::FocusedPluginIfInputMethodSupported(
1200 LocalFrame* frame) const { 1200 LocalFrame* frame) const {
1201 WebPluginContainerImpl* container = 1201 WebPluginContainerImpl* container =
1202 WebLocalFrameImpl::CurrentPluginContainer(frame); 1202 WebLocalFrameImpl::CurrentPluginContainer(frame);
1203 if (container && container->SupportsInputMethod()) 1203 if (container && container->SupportsInputMethod())
1204 return container->Plugin(); 1204 return container->Plugin();
1205 return nullptr; 1205 return nullptr;
1206 } 1206 }
1207 1207
1208 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameAvailableForIme() const { 1208 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameAvailableForIme() const {
1209 if (!ime_accept_events_) 1209 if (!ime_accept_events_)
1210 return nullptr; 1210 return nullptr;
1211 return FocusedLocalFrameInWidget(); 1211 return FocusedLocalFrameInWidget();
1212 } 1212 }
1213 1213
1214 } // namespace blink 1214 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698