Commit fcf2e230 authored by Mustaq Ahmed's avatar Mustaq Ahmed Committed by Commit Bot

Skip user activation notification when doc or frame is not available.

Change-Id: I4b30c9adb106e85e2e713af0d931f900123885be
Bug: 900198
Reviewed-on: https://chromium-review.googlesource.com/c/1307845Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604626}
parent d3f959d3
......@@ -230,10 +230,11 @@ void Notification::OnShow() {
void Notification::OnClick(OnClickCallback completed_closure) {
ExecutionContext* context = GetExecutionContext();
Document* document = DynamicTo<Document>(context);
std::unique_ptr<UserGestureIndicator> gesture_indicator =
LocalFrame::NotifyUserActivation(
document ? document->GetFrame() : nullptr,
UserGestureToken::kNewGesture);
std::unique_ptr<UserGestureIndicator> gesture_indicator;
if (document && document->GetFrame()) {
gesture_indicator = LocalFrame::NotifyUserActivation(
document->GetFrame(), UserGestureToken::kNewGesture);
}
ScopedWindowFocusAllowedIndicator window_focus_allowed(GetExecutionContext());
DispatchEvent(*Event::Create(event_type_names::kClick));
......
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