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

Unified Diff: ios/clean/chrome/browser/ui/tools/tools_coordinator.mm

Issue 2952213003: [ios clean] Refactors ToolsMenu and Tabs presentation (Closed)
Patch Set: Created 3 years, 6 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/clean/chrome/browser/ui/tools/tools_coordinator.mm
diff --git a/ios/clean/chrome/browser/ui/tools/tools_coordinator.mm b/ios/clean/chrome/browser/ui/tools/tools_coordinator.mm
index bc1c573b5a73881aeae3667d20971adfc3b9b739..7bdd6b257f4db5e53eda10d6663fcdef4deb74ba 100644
--- a/ios/clean/chrome/browser/ui/tools/tools_coordinator.mm
+++ b/ios/clean/chrome/browser/ui/tools/tools_coordinator.mm
@@ -4,25 +4,27 @@
#import "ios/clean/chrome/browser/ui/tools/tools_coordinator.h"
-#import "ios/clean/chrome/browser/ui/animators/zoom_transition_animator.h"
-#import "ios/clean/chrome/browser/ui/presenters/menu_presentation_controller.h"
#import "ios/clean/chrome/browser/ui/tools/menu_view_controller.h"
#import "ios/clean/chrome/browser/ui/tools/tools_mediator.h"
+#import "ios/clean/chrome/browser/ui/tools/tools_menu_transition_controller.h"
#import "ios/shared/chrome/browser/ui/browser_list/browser.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
-@interface ToolsCoordinator ()<UIViewControllerTransitioningDelegate>
-@property(nonatomic, strong) MenuViewController* viewController;
+@interface ToolsCoordinator ()
@property(nonatomic, strong) ToolsMediator* mediator;
+@property(nonatomic, strong)
+ ToolsMenuTransitionController* transitionController;
+@property(nonatomic, strong) MenuViewController* viewController;
@end
@implementation ToolsCoordinator
-@synthesize viewController = _viewController;
@synthesize mediator = _mediator;
+@synthesize transitionController = _transitionController;
@synthesize toolsMenuConfiguration = _toolsMenuConfiguration;
+@synthesize viewController = _viewController;
@synthesize webState = _webState;
#pragma mark - BrowserCoordinator
@@ -30,7 +32,9 @@
- (void)start {
self.viewController = [[MenuViewController alloc] init];
self.viewController.modalPresentationStyle = UIModalPresentationCustom;
- self.viewController.transitioningDelegate = self;
+ self.transitionController = [[ToolsMenuTransitionController alloc]
+ initWithDispatcher:static_cast<id>(self.browser->dispatcher())];
+ self.viewController.transitioningDelegate = self.transitionController;
self.viewController.dispatcher = static_cast<id>(self.browser->dispatcher());
self.mediator =
[[ToolsMediator alloc] initWithConsumer:self.viewController
@@ -50,36 +54,4 @@
}
}
-#pragma mark - UIViewControllerTransitioningDelegate
-
-- (id<UIViewControllerAnimatedTransitioning>)
-animationControllerForPresentedController:(UIViewController*)presented
- presentingController:(UIViewController*)presenting
- sourceController:(UIViewController*)source {
- ZoomTransitionAnimator* animator = [[ZoomTransitionAnimator alloc] init];
- animator.presenting = YES;
- [animator selectDelegate:@[ source, presenting ]];
- return animator;
-}
-
-- (id<UIViewControllerAnimatedTransitioning>)
-animationControllerForDismissedController:(UIViewController*)dismissed {
- ZoomTransitionAnimator* animator = [[ZoomTransitionAnimator alloc] init];
- animator.presenting = NO;
- [animator selectDelegate:@[ dismissed.presentingViewController ]];
- return animator;
-}
-
-- (UIPresentationController*)
-presentationControllerForPresentedViewController:(UIViewController*)presented
- presentingViewController:(UIViewController*)presenting
- sourceViewController:(UIViewController*)source {
- MenuPresentationController* menuPresentation =
- [[MenuPresentationController alloc]
- initWithPresentedViewController:presented
- presentingViewController:presenting];
- menuPresentation.dispatcher = static_cast<id>(self.browser->dispatcher());
- return menuPresentation;
-}
-
@end

Powered by Google App Engine
This is Rietveld 408576698