Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 96035f5

Browse files
committed
Review Changes
1 parent b83595e commit 96035f5

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

shell/platform/darwin/macos/framework/Source/FlutterIntermediateKeyResponder.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@
55
#import <Cocoa/Cocoa.h>
66

77
/*
8-
* An interface for adding key responders that can declare itself as the final
8+
* An interface for a key responder that can declare itself as the final
99
* responder of the event, terminating the event propagation.
1010
*
1111
* It differs from an NSResponder in that it returns a boolean from the
1212
* handleKeyUp and handleKeyDown calls, where true means it has handled the
13-
* given event. A handled event is not passed to the next responder.
13+
* given event.
1414
*/
1515
@interface FlutterIntermediateKeyResponder : NSObject
1616
/*
1717
* Informs the receiver that the user has released a key.
18+
*
19+
* Default implementation returns NO.
1820
*/
19-
- (BOOL)handleKeyUp:(NSEvent*)event;
21+
- (BOOL)handleKeyUp:(nonnull NSEvent*)event;
2022
/*
2123
* Informs the receiver that the user has pressed a key.
24+
*
25+
* Default implementation returns NO.
2226
*/
23-
- (BOOL)handleKeyDown:(NSEvent*)event;
27+
- (BOOL)handleKeyDown:(nonnull NSEvent*)event;
2428
@end

shell/platform/darwin/macos/framework/Source/FlutterViewController.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ @implementation FlutterViewController {
219219
* Performs initialization that's common between the different init paths.
220220
*/
221221
static void CommonInit(FlutterViewController* controller) {
222-
if (controller->_engine == nullptr) {
222+
if (!controller->_engine) {
223223
controller->_engine = [[FlutterEngine alloc] initWithName:@"io.flutter"
224224
project:controller->_project
225225
allowHeadlessExecution:NO];
@@ -260,11 +260,11 @@ - (instancetype)initWithEngine:(nonnull FlutterEngine*)engine
260260
self = [super initWithNibName:nibName bundle:nibBundle];
261261
if (self) {
262262
if (engine.viewController) {
263-
NSLog(@"The supplied FlutterEngine %s is already used with FlutterViewController "
264-
"instance %s. One instance of the FlutterEngine can only be attached to one "
263+
NSLog(@"The supplied FlutterEngine %@ is already used with FlutterViewController "
264+
"instance %@. One instance of the FlutterEngine can only be attached to one "
265265
"FlutterViewController at a time. Set FlutterEngine.viewController "
266266
"to nil before attaching it to another FlutterViewController.",
267-
[[engine description] UTF8String], [[engine.viewController description] UTF8String]);
267+
[engine description], [engine.viewController description]);
268268
}
269269
_engine = engine;
270270
CommonInit(self);

shell/platform/darwin/macos/framework/Source/FlutterViewControllerTest.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#include "FlutterBinaryMessenger.h"
5+
#import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h"
66
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h"
77

88
#import <OCMock/OCMock.h>
99

10+
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterBinaryMessenger.h"
1011
#import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterEngine.h"
1112
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterDartProject_Internal.h"
1213
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterEngine_Internal.h"
1314
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewControllerTestUtils.h"
14-
#include "flutter/testing/testing.h"
15+
#import "flutter/testing/testing.h"
1516

1617
@interface FlutterViewControllerTestObjC : NSObject
1718
- (bool)testKeyEventsAreSentToFramework;

0 commit comments

Comments
 (0)