Commit a742d6e2 authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Fix OverlayPresenterObserver callbacks.

The iteration loops mistakenly early returned if any observer didn't
support a request.  This prevents code after an observer iteration
from running if any of the observers don't support that request.

Bug: none
Change-Id: I8fe428ecbdaf54f416cf4bde547bc6aca9d10351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992362
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Auto-Submit: Kurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729628}
parent c8da96c9
...@@ -208,9 +208,8 @@ void OverlayPresenterImpl::PresentOverlayForActiveRequest() { ...@@ -208,9 +208,8 @@ void OverlayPresenterImpl::PresentOverlayForActiveRequest() {
// Notify the observers that the overlay UI is about to be shown. // Notify the observers that the overlay UI is about to be shown.
for (auto& observer : observers_) { for (auto& observer : observers_) {
if (!observer.GetRequestSupport(this)->IsRequestSupported(request)) if (observer.GetRequestSupport(this)->IsRequestSupported(request))
return; observer.WillShowOverlay(this, request);
observer.WillShowOverlay(this, request);
} }
// Present the overlay UI via the UI delegate. // Present the overlay UI via the UI delegate.
...@@ -231,9 +230,8 @@ void OverlayPresenterImpl::OverlayWasPresented( ...@@ -231,9 +230,8 @@ void OverlayPresenterImpl::OverlayWasPresented(
DCHECK_EQ(presentation_context_, presentation_context); DCHECK_EQ(presentation_context_, presentation_context);
DCHECK_EQ(presented_request_, request); DCHECK_EQ(presented_request_, request);
for (auto& observer : observers_) { for (auto& observer : observers_) {
if (!observer.GetRequestSupport(this)->IsRequestSupported(request)) if (observer.GetRequestSupport(this)->IsRequestSupported(request))
return; observer.DidShowOverlay(this, request);
observer.DidShowOverlay(this, request);
} }
} }
...@@ -271,9 +269,8 @@ void OverlayPresenterImpl::OverlayWasDismissed( ...@@ -271,9 +269,8 @@ void OverlayPresenterImpl::OverlayWasDismissed(
// Notify the observers that the overlay UI was hidden. // Notify the observers that the overlay UI was hidden.
for (auto& observer : observers_) { for (auto& observer : observers_) {
if (!observer.GetRequestSupport(this)->IsRequestSupported(request)) if (observer.GetRequestSupport(this)->IsRequestSupported(request))
return; observer.DidHideOverlay(this, request);
observer.DidHideOverlay(this, request);
} }
// Only show the next overlay if the active request has changed, either // Only show the next overlay if the active request has changed, either
......
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