Commit eac89721 authored by Robbie Gibson's avatar Robbie Gibson Committed by Commit Bot

[iOS] Fix showing edit menu on long-press in location bar

The edit menu was being shown inside a DCHECK.
(I.e DCHECK([self methodWithSideEffects]). This meant that it was
stripped out in release builds, but not in debug, which is why this
didn't reproduce locally.

Bug: 1134647
Change-Id: Idbe1a48d0f9c82543cffcc3f79d05128e9589470
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462266
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Auto-Submit: Robbie Gibson <rkgibson@google.com>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815615}
parent 4c85ed87
...@@ -596,7 +596,7 @@ const NSString* kScribbleOmniboxElementId = @"omnibox"; ...@@ -596,7 +596,7 @@ const NSString* kScribbleOmniboxElementId = @"omnibox";
initWithTitle:l10n_util::GetNSString(IDS_IOS_SEARCH_COPIED_TEXT) initWithTitle:l10n_util::GetNSString(IDS_IOS_SEARCH_COPIED_TEXT)
action:@selector(searchCopiedText:)]); action:@selector(searchCopiedText:)]);
DCHECK([self updateCachedClipboardStateWithCompletion:^() { BOOL updateSuccessful = [self updateCachedClipboardStateWithCompletion:^() {
if (@available(iOS 13, *)) { if (@available(iOS 13, *)) {
[menu showMenuFromView:self.view rect:self.locationBarSteadyView.frame]; [menu showMenuFromView:self.view rect:self.locationBarSteadyView.frame];
} else { } else {
...@@ -608,7 +608,8 @@ const NSString* kScribbleOmniboxElementId = @"omnibox"; ...@@ -608,7 +608,8 @@ const NSString* kScribbleOmniboxElementId = @"omnibox";
// presented menu. // presented menu.
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,
menu); menu);
}]); }];
DCHECK(updateSuccessful);
} }
} }
......
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