Commit e8c4e1ac authored by Eugene But's avatar Eugene But Committed by Commit Bot

[ios] Fix DCHECK in reportBackUserAction

Do not call reportBackUserAction on SettingsTableViewController as root
settings view controller does not have "back" button and does not have
to record "back" metric.

DCHECK was hapenning after dragging SettingsTableViewController bottom
and returning it back, which called presentation callback for root
settings controller.

Bug: 1117512
Change-Id: I45f3a2285007e8098b9155501a9c526fecf1df8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363003
Auto-Submit: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799734}
parent 62046aa7
...@@ -465,9 +465,11 @@ NSString* const kSettingsDoneButtonId = @"kSettingsDoneButtonId"; ...@@ -465,9 +465,11 @@ NSString* const kSettingsDoneButtonId = @"kSettingsDoneButtonId";
willShowViewController:(UIViewController*)viewController willShowViewController:(UIViewController*)viewController
animated:(BOOL)animated { animated:(BOOL)animated {
if ([viewController isMemberOfClass:[SettingsTableViewController class]] && if ([viewController isMemberOfClass:[SettingsTableViewController class]] &&
![self.currentPresentedViewController
isMemberOfClass:[SettingsTableViewController class]] &&
[self.currentPresentedViewController [self.currentPresentedViewController
conformsToProtocol:@protocol(SettingsControllerProtocol)]) { conformsToProtocol:@protocol(SettingsControllerProtocol)]) {
// Navigated back to SettingsTableViewController. // Navigated back to root SettingsController from leaf SettingsController.
[self.currentPresentedViewController [self.currentPresentedViewController
performSelector:@selector(reportBackUserAction)]; performSelector:@selector(reportBackUserAction)];
} }
......
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