Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: ios/chrome/browser/ui/elements/selector_coordinator.mm

Issue 2125813002: Add custom UIPresentationController for picker selector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: name shortening Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/elements/selector_coordinator.mm
diff --git a/ios/chrome/browser/ui/elements/selector_coordinator.mm b/ios/chrome/browser/ui/elements/selector_coordinator.mm
index 64052ec7c213fa7568942155759399ab4b0b6489..155daeedaac90aa89b6e4409fff18f0751d62926 100644
--- a/ios/chrome/browser/ui/elements/selector_coordinator.mm
+++ b/ios/chrome/browser/ui/elements/selector_coordinator.mm
@@ -6,9 +6,11 @@
#import "base/mac/objc_property_releaser.h"
#import "ios/chrome/browser/ui/elements/selector_picker_view_controller.h"
+#import "ios/chrome/browser/ui/elements/selector_picker_presentation_controller.h"
#import "ios/chrome/browser/ui/elements/selector_view_controller_delegate.h"
-@interface SelectorCoordinator ()<SelectorViewControllerDelegate> {
+@interface SelectorCoordinator ()<SelectorViewControllerDelegate,
+ UIViewControllerTransitioningDelegate> {
base::mac::ObjCPropertyReleaser _propertyReleaser_SelectorCoordinator;
__unsafe_unretained id<SelectorCoordinatorDelegate> _delegate;
__unsafe_unretained NSOrderedSet<NSString*>* _options;
@@ -42,12 +44,13 @@
[[SelectorPickerViewController alloc] initWithOptions:self.options
default:self.defaultOption];
self.selectorPickerViewController.delegate = self;
- // TODO(crbug.com/622244): Display via custom UIPresentionController to
- // show as a bottom sheet.
+
self.selectorPickerViewController.modalTransitionStyle =
UIModalTransitionStyleCoverVertical;
self.selectorPickerViewController.modalPresentationStyle =
- UIModalPresentationFormSheet;
+ UIModalPresentationCustom;
+ self.selectorPickerViewController.transitioningDelegate = self;
+
[self.baseViewController
presentViewController:self.selectorPickerViewController
animated:YES
@@ -67,4 +70,15 @@
[self stop];
}
+#pragma mark UIViewControllerTransitioningDelegate
+
+- (UIPresentationController*)
+presentationControllerForPresentedViewController:(UIViewController*)presented
+ presentingViewController:(UIViewController*)presenting
+ sourceViewController:(UIViewController*)source {
+ return [[[SelectorPickerPresentationController alloc]
+ initWithPresentedViewController:self.selectorPickerViewController
+ presentingViewController:self.baseViewController] autorelease];
+}
+
@end
« no previous file with comments | « ios/chrome/browser/BUILD.gn ('k') | ios/chrome/browser/ui/elements/selector_picker_presentation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698