From a919fb99d3f8d72cbd8241520368bfb884d095d0 Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Fri, 28 Oct 2022 13:05:21 -0700 Subject: [PATCH] Remove deprecated TextInputClient scribble method code (flutter/engine#36970) --- .../ios/framework/Source/FlutterEngine.mm | 37 ------------------- .../Source/FlutterTextInputPlugin.mm | 10 ----- 2 files changed, 47 deletions(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index 0ba83ef380..bb996706cb 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -975,10 +975,6 @@ static void SetEntryPoint(flutter::Settings* settings, NSString* entrypoint, NSS #pragma mark - FlutterViewEngineDelegate - (void)flutterTextInputView:(FlutterTextInputView*)textInputView showToolbar:(int)client { - // TODO(justinmc): Remove the TextInputClient usage when the framework has - // finished transitioning to using the Scribble channel. - // https://github.com/flutter/flutter/pull/104128 - [_textInputChannel.get() invokeMethod:@"TextInputClient.showToolbar" arguments:@[ @(client) ]]; [_scribbleChannel.get() invokeMethod:@"Scribble.showToolbar" arguments:@[ @(client) ]]; } @@ -986,13 +982,6 @@ static void SetEntryPoint(flutter::Settings* settings, NSString* entrypoint, NSS focusElement:(UIScribbleElementIdentifier)elementIdentifier atPoint:(CGPoint)referencePoint result:(FlutterResult)callback { - // TODO(justinmc): Remove the TextInputClient usage when the framework has - // finished transitioning to using the Scribble channel. - // https://github.com/flutter/flutter/pull/104128 - [_textInputChannel.get() - invokeMethod:@"TextInputClient.focusElement" - arguments:@[ elementIdentifier, @(referencePoint.x), @(referencePoint.y) ] - result:callback]; [_scribbleChannel.get() invokeMethod:@"Scribble.focusElement" arguments:@[ elementIdentifier, @(referencePoint.x), @(referencePoint.y) ] @@ -1002,55 +991,29 @@ static void SetEntryPoint(flutter::Settings* settings, NSString* entrypoint, NSS - (void)flutterTextInputPlugin:(FlutterTextInputPlugin*)textInputPlugin requestElementsInRect:(CGRect)rect result:(FlutterResult)callback { - // TODO(justinmc): Remove the TextInputClient usage when the framework has - // finished transitioning to using the Scribble channel. - // https://github.com/flutter/flutter/pull/104128 [_scribbleChannel.get() invokeMethod:@"Scribble.requestElementsInRect" arguments:@[ @(rect.origin.x), @(rect.origin.y), @(rect.size.width), @(rect.size.height) ] result:callback]; - [_textInputChannel.get() - invokeMethod:@"TextInputClient.requestElementsInRect" - arguments:@[ @(rect.origin.x), @(rect.origin.y), @(rect.size.width), @(rect.size.height) ] - result:callback]; } - (void)flutterTextInputViewScribbleInteractionBegan:(FlutterTextInputView*)textInputView { - // TODO(justinmc): Remove the TextInputClient usage when the framework has - // finished transitioning to using the Scribble channel. - // https://github.com/flutter/flutter/pull/104128 - [_textInputChannel.get() invokeMethod:@"TextInputClient.scribbleInteractionBegan" arguments:nil]; [_scribbleChannel.get() invokeMethod:@"Scribble.scribbleInteractionBegan" arguments:nil]; } - (void)flutterTextInputViewScribbleInteractionFinished:(FlutterTextInputView*)textInputView { - // TODO(justinmc): Remove the TextInputClient usage when the framework has - // finished transitioning to using the Scribble channel. - // https://github.com/flutter/flutter/pull/104128 - [_textInputChannel.get() invokeMethod:@"TextInputClient.scribbleInteractionFinished" - arguments:nil]; [_scribbleChannel.get() invokeMethod:@"Scribble.scribbleInteractionFinished" arguments:nil]; } - (void)flutterTextInputView:(FlutterTextInputView*)textInputView insertTextPlaceholderWithSize:(CGSize)size withClient:(int)client { - // TODO(justinmc): Remove the TextInputClient usage when the framework has - // finished transitioning to using the Scribble channel. - // https://github.com/flutter/flutter/pull/104128 - [_textInputChannel.get() invokeMethod:@"TextInputClient.insertTextPlaceholder" - arguments:@[ @(client), @(size.width), @(size.height) ]]; [_scribbleChannel.get() invokeMethod:@"Scribble.insertTextPlaceholder" arguments:@[ @(client), @(size.width), @(size.height) ]]; } - (void)flutterTextInputView:(FlutterTextInputView*)textInputView removeTextPlaceholder:(int)client { - // TODO(justinmc): Remove the TextInputClient usage when the framework has - // finished transitioning to using the Scribble channel. - // https://github.com/flutter/flutter/pull/104128 - [_textInputChannel.get() invokeMethod:@"TextInputClient.removeTextPlaceholder" - arguments:@[ @(client) ]]; [_scribbleChannel.get() invokeMethod:@"Scribble.removeTextPlaceholder" arguments:@[ @(client) ]]; } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 4ecdc6845e..fc4230015c 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -48,10 +48,6 @@ static NSString* const kSetEditableSizeAndTransformMethod = @"TextInput.setEditableSizeAndTransform"; static NSString* const kSetMarkedTextRectMethod = @"TextInput.setMarkedTextRect"; static NSString* const kFinishAutofillContextMethod = @"TextInput.finishAutofillContext"; -// TODO(justinmc): Remove the TextInput method constant when the framework has -// finished transitioning to using the Scribble channel. -// https://github.com/flutter/flutter/pull/104128 -static NSString* const kDeprecatedSetSelectionRectsMethod = @"TextInput.setSelectionRects"; static NSString* const kSetSelectionRectsMethod = @"Scribble.setSelectionRects"; static NSString* const kStartLiveTextInputMethod = @"TextInput.startLiveTextInput"; @@ -2174,12 +2170,6 @@ static BOOL IsSelectionRectCloserToPoint(CGPoint point, } else if ([method isEqualToString:kFinishAutofillContextMethod]) { [self triggerAutofillSave:[args boolValue]]; result(nil); - // TODO(justinmc): Remove the TextInput method constant when the framework has - // finished transitioning to using the Scribble channel. - // https://github.com/flutter/flutter/pull/104128 - } else if ([method isEqualToString:kDeprecatedSetSelectionRectsMethod]) { - [self setSelectionRects:args]; - result(nil); } else if ([method isEqualToString:kSetSelectionRectsMethod]) { [self setSelectionRects:args]; result(nil);