Commit 8de05861 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Do nothing if new TranslateStep is the same as the current state

This situation can be triggered by the Translate Infobar being shown
and the page is translated when the user taps on the Translate button
in the Overflow menu. In this situation, the new step (AFTER_TRANSLATE)
matches the current state.

Bug: 1033888
Change-Id: I4f330e8b32d75931551273218017019baacac21c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1975691
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Auto-Submit: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726510}
parent a67e3ac3
...@@ -113,7 +113,12 @@ NSString* const kTranslateNotificationSnackbarCategory = ...@@ -113,7 +113,12 @@ NSString* const kTranslateNotificationSnackbarCategory =
- (void)translateInfoBarDelegate:(translate::TranslateInfoBarDelegate*)delegate - (void)translateInfoBarDelegate:(translate::TranslateInfoBarDelegate*)delegate
didChangeTranslateStep:(translate::TranslateStep)step didChangeTranslateStep:(translate::TranslateStep)step
withErrorType:(translate::TranslateErrors::Type)errorType { withErrorType:(translate::TranslateErrors::Type)errorType {
DCHECK(self.currentStep != step); if (self.currentStep == step) {
// No need to re-present or take any action if the new step is already the
// same as the current state. (e.g. the page is already translated and
// Translate is tapped in the overflow menu).
return;
}
self.currentStep = step; self.currentStep = step;
self.mediator.currentStep = step; self.mediator.currentStep = step;
switch (self.currentStep) { switch (self.currentStep) {
......
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