Index: ios/chrome/browser/find_in_page/find_in_page_controller.mm |
diff --git a/ios/chrome/browser/find_in_page/find_in_page_controller.mm b/ios/chrome/browser/find_in_page/find_in_page_controller.mm |
index 692d7f6eb914b86abf8db36f3bdc7df31b3af385..0d799069c3bfa880005e2c5ece1c2341caf0eee6 100644 |
--- a/ios/chrome/browser/find_in_page/find_in_page_controller.mm |
+++ b/ios/chrome/browser/find_in_page/find_in_page_controller.mm |
@@ -268,15 +268,17 @@ static NSString* gSearchTerm; |
// Remove highlights from the page and disable the model. |
- (void)disableFindInPageWithCompletionHandler: |
(ProceduralBlock)completionHandler { |
- if (![self canFindInPage]) |
+ if (![self canFindInPage]) { |
+ if (completionHandler) |
+ completionHandler(); |
return; |
+ } |
// Cancel any queued calls to |recurringPumpWithCompletionHandler|. |
[NSObject cancelPreviousPerformRequestsWithTarget:self]; |
__weak FindInPageController* weakSelf = self; |
ProceduralBlock handler = ^{ |
FindInPageController* strongSelf = weakSelf; |
if (strongSelf) { |
- [strongSelf.findInPageModel setEnabled:NO]; |
web::WebState* webState = [strongSelf webState]; |
if (webState) |
DOMAlteringLock::FromWebState(webState)->Release(strongSelf); |