Commit 775a2ebe authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

Increment stat when an occluded window handles a mouse event.

Bug: 813093
Change-Id: I72bb4fc6ff11e1499f606851606b49b6f7e80bab
Reviewed-on: https://chromium-review.googlesource.com/c/1359301Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613437}
parent 9ee0481f
......@@ -70384,6 +70384,18 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="OccludedWindowMouseEvents" units="events"
expires_after="2019-12-01">
<owner>davidbienvenu@chromium.org</owner>
<owner>fdoray@chromium.org</owner>
<summary>
Incremented each time a mouse event is handled by a window that is marked as
occluded. This number should be 0 or very close to 0. It should be much less
than the number of times a window is mark occluded -
WindowOcclusionChanged.Occluded.
</summary>
</histogram>
<histogram name="OfflineIndicator.CTR" enum="OfflineIndicatorCTREvent"
expires_after="2019-06-30">
<owner>dimich@chromium.org</owner>
......@@ -6,6 +6,7 @@
#include "base/containers/flat_set.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/aura/client/aura_constants.h"
......@@ -897,9 +898,13 @@ void DesktopWindowTreeHostWin::HandleNativeBlur(HWND focused_window) {
}
bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) {
// TODO(davidbienvenu): Check for getting mouse events for an occluded window
// with either a DCHECK or a stat. Event can cause this object to be deleted
// so look at occlusion state before we do anything with the event.
// Mouse events in occluded windows should be very rare. If this stat isn't
// very close to 0, that would indicate that windows are incorrectly getting
// marked occluded, or getting stuck in the occluded state. Event can cause
// this object to be deleted so check occlusion state before we do anything
// with the event.
if (window()->occlusion_state() == aura::Window::OcclusionState::OCCLUDED)
UMA_HISTOGRAM_BOOLEAN("OccludedWindowMouseEvents", true);
SendEventToSink(event);
return event->handled();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment