This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Add application:openURLs: forwarding on macOS#44689
Merged
auto-submit[bot] merged 2 commits intoflutter:mainfrom Aug 14, 2023
Merged
Add application:openURLs: forwarding on macOS#44689auto-submit[bot] merged 2 commits intoflutter:mainfrom
auto-submit[bot] merged 2 commits intoflutter:mainfrom
Conversation
Wires `application:openURLs:` into the exisiting delegation system, allowing plugins to handle URL callbacks (as on iOS). Since there is no notification-based version of this delegate method, this adds it directly to the app delegate, restructring the helper class slightly to allow internal sharing of the delegate list. Part of flutter/flutter#41471
stuartmorgan-g
commented
Aug 14, 2023
| * The application menu in the menu bar. | ||
| */ | ||
| @property(weak, nonatomic) IBOutlet NSMenu* applicationMenu; | ||
| @property(weak, nonatomic, nullable) IBOutlet NSMenu* applicationMenu; |
Contributor
Author
There was a problem hiding this comment.
I missed adding these when I added nullability annotations to the split-out delegate above, which causes warnings about not having full nullability annotation.
| - (void)removeDelegate:(NSObject<FlutterAppLifecycleDelegate>*)delegate { | ||
| NSUInteger index = [[_delegates allObjects] indexOfObject:delegate]; | ||
| if (index >= 0) { | ||
| if (index != NSNotFound) { |
Contributor
Author
There was a problem hiding this comment.
Noticed while I was looking at the existing structure; the previous code was wrong since index is unsigned. NSNotFound is the unsigned version of -1, but not actually negative.
shell/platform/darwin/macos/framework/Source/FlutterAppLifecycleDelegate.mm
Show resolved
Hide resolved
cbracken
approved these changes
Aug 14, 2023
Member
cbracken
left a comment
There was a problem hiding this comment.
Overall lgtm barring one question on the removed nil check.
| EXPECT_EQ([delegate receivedURLs], URLs); | ||
| } | ||
|
|
||
| TEST(FlutterAppDelegateTest, OperURLsStopsAfterHandled) { |
Member
There was a problem hiding this comment.
Nice - thanks for adding this one.
| - (void)removeDelegate:(NSObject<FlutterAppLifecycleDelegate>*)delegate { | ||
| NSUInteger index = [[_delegates allObjects] indexOfObject:delegate]; | ||
| if (index >= 0) { | ||
| if (index != NSNotFound) { |
shell/platform/darwin/macos/framework/Source/FlutterAppLifecycleDelegate.mm
Show resolved
Hide resolved
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Aug 14, 2023
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Aug 14, 2023
flutter/engine@56a0e27...785b249 2023-08-14 amirpanahandeh@yahoo.com Update CompositionAwareMixin to correctly compute composingBase in Web engine (flutter/engine#44139) 2023-08-14 stuartmorgan@google.com Add application:openURLs: forwarding on macOS (flutter/engine#44689) 2023-08-14 skia-flutter-autoroll@skia.org Roll Skia from a4377099b25a to 69ea58157190 (1 revision) (flutter/engine#44692) 2023-08-14 chillers@google.com Update embedder_semantics_update.h imports to include flutter namespace (flutter/engine#44670) 2023-08-14 skia-flutter-autoroll@skia.org Roll Dart SDK from 3295a353980a to d445f5a18876 (1 revision) (flutter/engine#44691) 2023-08-14 dnfield@google.com Revert "Make run_tests.py assert that the ios test dylib is at least as new as libFlutter.dylib" (flutter/engine#44690) 2023-08-14 skia-flutter-autoroll@skia.org Roll Skia from 1cf6f71c8120 to a4377099b25a (1 revision) (flutter/engine#44688) 2023-08-14 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from JKTVoxVrHjZjBaxG4... to uIGMbDkXoIcpqWjgR... (flutter/engine#44687) 2023-08-14 jonahwilliams@google.com [Impeller] Conditionally set command debug info. (flutter/engine#44274) 2023-08-14 kjlubick@users.noreply.github.com Migrate more GL calls of GrBackend* (flutter/engine#44682) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from JKTVoxVrHjZj to uIGMbDkXoIcp If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC chinmaygarde@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gaaclarke
pushed a commit
to gaaclarke/engine
that referenced
this pull request
Aug 30, 2023
Wires `application:openURLs:` into the exisiting delegation system, allowing plugins to handle URL callbacks (as on iOS). Since there is no notification-based version of this delegate method, this adds it directly to the app delegate, restructring the helper class slightly to allow internal sharing of the delegate list. Fixes flutter/flutter#41471 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires
application:openURLs:into the exisiting delegation system, allowing plugins to handle URL callbacks (as on iOS).Since there is no notification-based version of this delegate method, this adds it directly to the app delegate, restructring the helper class slightly to allow internal sharing of the delegate list.
Fixes flutter/flutter#41471
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.