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

Make activation notification to other processes unconditional

We originally had the notification conditional on whether the current
frame had been activated before or not.  This works fine for the sticky
activation bit but for the transient bit (which can expire or get
consumed), other processes should be notified at every user activation.

Bug: 780556, 775930
Change-Id: I902129651504371bad0b9ab841e65b223bee46b4
Reviewed-on: https://chromium-review.googlesource.com/973507Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546229}
parent 203787a4
......@@ -1024,17 +1024,9 @@ KURL LocalFrameClientImpl::OverrideFlashEmbedWithHTML(const KURL& url) {
return web_frame_->Client()->OverrideFlashEmbedWithHTML(WebURL(url));
}
void LocalFrameClientImpl::SetHasReceivedUserGesture(bool received_previously) {
// The client potentially needs to dispatch the event to other processes only
// for the first time.
//
// TODO(mustaq): Can we remove |received_previously|, specially when
// autofill-client below ignores it already? crbug.com/775930
if (!received_previously && web_frame_->Client())
web_frame_->Client()->SetHasReceivedUserGesture();
// WebAutofillClient reacts only to the user gestures for this particular
// frame. |received_previously| is ignored because it may be true due to an
// event in a child frame.
void LocalFrameClientImpl::SetHasReceivedUserGesture() {
DCHECK(web_frame_->Client());
web_frame_->Client()->SetHasReceivedUserGesture();
if (WebAutofillClient* autofill_client = web_frame_->AutofillClient())
autofill_client->UserGestureObserved();
}
......
......@@ -234,7 +234,7 @@ class LocalFrameClientImpl final : public LocalFrameClient {
KURL OverrideFlashEmbedWithHTML(const KURL&) override;
void SetHasReceivedUserGesture(bool received_previously) override;
void SetHasReceivedUserGesture() override;
void SetHasReceivedUserGestureBeforeNavigation(bool value) override;
......
......@@ -181,12 +181,8 @@ void Frame::NotifyUserActivationInLocalTree() {
}
void Frame::NotifyUserActivation() {
bool had_gesture = HasBeenActivated();
if (RuntimeEnabledFeatures::UserActivationV2Enabled() || !had_gesture)
NotifyUserActivationInLocalTree();
DCHECK(IsLocalFrame());
ToLocalFrame(this)->Client()->SetHasReceivedUserGesture(had_gesture);
NotifyUserActivationInLocalTree();
ToLocalFrame(this)->Client()->SetHasReceivedUserGesture();
}
bool Frame::ConsumeTransientUserActivation() {
......
......@@ -365,7 +365,7 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
return nullptr;
}
virtual void SetHasReceivedUserGesture(bool received_previously) {}
virtual void SetHasReceivedUserGesture() {}
virtual void SetHasReceivedUserGestureBeforeNavigation(bool value) {}
......
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