| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/chrome/browser/ui/elements/selector_coordinator.h" | 5 #import "ios/chrome/browser/ui/elements/selector_coordinator.h" |
| 6 | 6 |
| 7 #import "ios/chrome/browser/ui/elements/selector_picker_view_controller.h" | 7 #import "ios/chrome/browser/ui/elements/selector_picker_view_controller.h" |
| 8 #import "ios/chrome/browser/ui/elements/selector_picker_presentation_controller.
h" | 8 #import "ios/chrome/browser/ui/elements/selector_picker_presentation_controller.
h" |
| 9 #import "ios/chrome/browser/ui/elements/selector_view_controller_delegate.h" | 9 #import "ios/chrome/browser/ui/elements/selector_view_controller_delegate.h" |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 UIModalPresentationCustom; | 42 UIModalPresentationCustom; |
| 43 self.selectorPickerViewController.transitioningDelegate = self; | 43 self.selectorPickerViewController.transitioningDelegate = self; |
| 44 | 44 |
| 45 [self.baseViewController | 45 [self.baseViewController |
| 46 presentViewController:self.selectorPickerViewController | 46 presentViewController:self.selectorPickerViewController |
| 47 animated:YES | 47 animated:YES |
| 48 completion:nil]; | 48 completion:nil]; |
| 49 } | 49 } |
| 50 | 50 |
| 51 - (void)stop { | 51 - (void)stop { |
| 52 [self.selectorPickerViewController dismissViewControllerAnimated:YES | 52 [self.selectorPickerViewController.presentingViewController |
| 53 completion:nil]; | 53 dismissViewControllerAnimated:YES |
| 54 completion:nil]; |
| 54 } | 55 } |
| 55 | 56 |
| 56 #pragma mark SelectorViewControllerDelegate | 57 #pragma mark SelectorViewControllerDelegate |
| 57 | 58 |
| 58 - (void)selectorViewController:(UIViewController*)viewController | 59 - (void)selectorViewController:(UIViewController*)viewController |
| 59 didSelectOption:(NSString*)option { | 60 didSelectOption:(NSString*)option { |
| 60 [self.delegate selectorCoordinator:self didCompleteWithSelection:option]; | 61 [self.delegate selectorCoordinator:self didCompleteWithSelection:option]; |
| 61 [self stop]; | 62 [self stop]; |
| 62 } | 63 } |
| 63 | 64 |
| 64 #pragma mark UIViewControllerTransitioningDelegate | 65 #pragma mark UIViewControllerTransitioningDelegate |
| 65 | 66 |
| 66 - (UIPresentationController*) | 67 - (UIPresentationController*) |
| 67 presentationControllerForPresentedViewController:(UIViewController*)presented | 68 presentationControllerForPresentedViewController:(UIViewController*)presented |
| 68 presentingViewController:(UIViewController*)presenting | 69 presentingViewController:(UIViewController*)presenting |
| 69 sourceViewController:(UIViewController*)source { | 70 sourceViewController:(UIViewController*)source { |
| 70 return [[SelectorPickerPresentationController alloc] | 71 return [[SelectorPickerPresentationController alloc] |
| 71 initWithPresentedViewController:self.selectorPickerViewController | 72 initWithPresentedViewController:self.selectorPickerViewController |
| 72 presentingViewController:self.baseViewController]; | 73 presentingViewController:self.baseViewController]; |
| 73 } | 74 } |
| 74 | 75 |
| 75 @end | 76 @end |
| OLD | NEW |