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

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

Issue 2883273003: Move the user interaction policy for FirstMeaningfulPaint UMA into renderer (Closed)
Patch Set: add testcase Created 3 years, 6 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) 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #include "core/page/ContextMenuProvider.h" 86 #include "core/page/ContextMenuProvider.h"
87 #include "core/page/FocusController.h" 87 #include "core/page/FocusController.h"
88 #include "core/page/FrameTree.h" 88 #include "core/page/FrameTree.h"
89 #include "core/page/Page.h" 89 #include "core/page/Page.h"
90 #include "core/page/PagePopupClient.h" 90 #include "core/page/PagePopupClient.h"
91 #include "core/page/PointerLockController.h" 91 #include "core/page/PointerLockController.h"
92 #include "core/page/ScopedPageSuspender.h" 92 #include "core/page/ScopedPageSuspender.h"
93 #include "core/page/TouchDisambiguation.h" 93 #include "core/page/TouchDisambiguation.h"
94 #include "core/page/ValidationMessageClientImpl.h" 94 #include "core/page/ValidationMessageClientImpl.h"
95 #include "core/page/scrolling/TopDocumentRootScrollerController.h" 95 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
96 #include "core/paint/FirstMeaningfulPaintDetector.h"
96 #include "core/paint/PaintLayer.h" 97 #include "core/paint/PaintLayer.h"
97 #include "core/timing/DOMWindowPerformance.h" 98 #include "core/timing/DOMWindowPerformance.h"
98 #include "core/timing/Performance.h" 99 #include "core/timing/Performance.h"
99 #include "modules/accessibility/AXObjectCacheImpl.h" 100 #include "modules/accessibility/AXObjectCacheImpl.h"
100 #include "modules/compositorworker/AnimationWorkletProxyClientImpl.h" 101 #include "modules/compositorworker/AnimationWorkletProxyClientImpl.h"
101 #include "modules/compositorworker/CompositorWorkerProxyClientImpl.h" 102 #include "modules/compositorworker/CompositorWorkerProxyClientImpl.h"
102 #include "modules/credentialmanager/CredentialManagerClient.h" 103 #include "modules/credentialmanager/CredentialManagerClient.h"
103 #include "modules/encryptedmedia/MediaKeysController.h" 104 #include "modules/encryptedmedia/MediaKeysController.h"
104 #include "modules/speech/SpeechRecognitionClientProxy.h" 105 #include "modules/speech/SpeechRecognitionClientProxy.h"
105 #include "modules/storage/StorageNamespaceController.h" 106 #include "modules/storage/StorageNamespaceController.h"
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 if (WebWidgetClient* client = widget->Client()) 2198 if (WebWidgetClient* client = widget->Client())
2198 is_pointer_locked = client->IsPointerLocked(); 2199 is_pointer_locked = client->IsPointerLocked();
2199 } 2200 }
2200 2201
2201 if (is_pointer_locked && 2202 if (is_pointer_locked &&
2202 WebInputEvent::IsMouseEventType(input_event.GetType())) { 2203 WebInputEvent::IsMouseEventType(input_event.GetType())) {
2203 MainFrameImpl()->FrameWidget()->PointerLockMouseEvent(coalesced_event); 2204 MainFrameImpl()->FrameWidget()->PointerLockMouseEvent(coalesced_event);
2204 return WebInputEventResult::kHandledSystem; 2205 return WebInputEventResult::kHandledSystem;
2205 } 2206 }
2206 2207
2208 if (input_event.GetType() != WebInputEvent::kMouseMove) {
2209 FirstMeaningfulPaintDetector::From(
2210 *MainFrameImpl()->GetFrame()->GetDocument())
2211 .NotifyInputEvent();
2212 }
2213
2207 if (mouse_capture_node_ && 2214 if (mouse_capture_node_ &&
2208 WebInputEvent::IsMouseEventType(input_event.GetType())) { 2215 WebInputEvent::IsMouseEventType(input_event.GetType())) {
2209 TRACE_EVENT1("input", "captured mouse event", "type", 2216 TRACE_EVENT1("input", "captured mouse event", "type",
2210 input_event.GetType()); 2217 input_event.GetType());
2211 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it. 2218 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it.
2212 Node* node = mouse_capture_node_; 2219 Node* node = mouse_capture_node_;
2213 2220
2214 // Not all platforms call mouseCaptureLost() directly. 2221 // Not all platforms call mouseCaptureLost() directly.
2215 if (input_event.GetType() == WebInputEvent::kMouseUp) 2222 if (input_event.GetType() == WebInputEvent::kMouseUp)
2216 MouseCaptureLost(); 2223 MouseCaptureLost();
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after
4139 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4146 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4140 return nullptr; 4147 return nullptr;
4141 return focused_frame; 4148 return focused_frame;
4142 } 4149 }
4143 4150
4144 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4151 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4145 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4152 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4146 } 4153 }
4147 4154
4148 } // namespace blink 4155 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698