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

Unified Diff: ios/clean/chrome/browser/ui/tools/tools_menu_transition_controller.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_menu_transition_controller.mm
diff --git a/ios/clean/chrome/browser/ui/tools/tools_menu_transition_controller.mm b/ios/clean/chrome/browser/ui/tools/tools_menu_transition_controller.mm
new file mode 100644
index 0000000000000000000000000000000000000000..7956677578d876157cba3372b054f060006f22ee
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/tools/tools_menu_transition_controller.mm
@@ -0,0 +1,36 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/clean/chrome/browser/ui/tools/tools_menu_transition_controller.h"
+
+#import "ios/clean/chrome/browser/ui/presenters/menu_presentation_controller.h"
+
+@interface ToolsMenuTransitionController ()
+@property(nonatomic, weak) id<ToolsMenuCommands> dispatcher;
+@end
+
+@implementation ToolsMenuTransitionController
+@synthesize dispatcher = _dispatcher;
+
+- (instancetype)initWithDispatcher:(id<ToolsMenuCommands>)dispatcher {
+ self = [super init];
+ if (self) {
+ _dispatcher = dispatcher;
+ }
+ return self;
+}
+
+- (UIPresentationController*)
+presentationControllerForPresentedViewController:(UIViewController*)presented
+ presentingViewController:(UIViewController*)presenting
+ sourceViewController:(UIViewController*)source {
+ MenuPresentationController* menuPresentation =
+ [[MenuPresentationController alloc]
+ initWithPresentedViewController:presented
+ presentingViewController:presenting];
+ menuPresentation.dispatcher = static_cast<id>(self.dispatcher);
marq (ping after 24h) 2017/06/23 09:18:49 Shouldn't menuPresentation.dispatcher already be a
sczs 2017/06/23 14:50:20 Yes! I copied this code over and didn't change thi
+ return menuPresentation;
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698