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

Side by Side Diff: ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.h

Issue 2948463002: [iOS Clean] Removed old overlay implementation.
Patch Set: rebase & Mark's comments Created 3 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 unified diff | Download patch
OLDNEW
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 #ifndef IOS_SHARED_CHROME_BROWSER_UI_COORDINATORS_BROWSER_COORDINATOR_INTERNAL_H _ 5 #ifndef IOS_SHARED_CHROME_BROWSER_UI_COORDINATORS_BROWSER_COORDINATOR_INTERNAL_H _
6 #define IOS_SHARED_CHROME_BROWSER_UI_COORDINATORS_BROWSER_COORDINATOR_INTERNAL_H _ 6 #define IOS_SHARED_CHROME_BROWSER_UI_COORDINATORS_BROWSER_COORDINATOR_INTERNAL_H _
7 7
8 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator.h" 8 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator.h"
9 9
10 // Internal API for subclasses and categories of BrowserCoordinator. 10 // Internal API for subclasses and categories of BrowserCoordinator.
11 //
12 // This API can be used to create and manage 'overlay coordinators'.
13 // Overlay coordinators are intended to be used for UI elements that
14 // sit on top of the regular UI, and which may need to be dismissed
15 // by coordinators that don't have direct access to them. Typical uses
16 // would be alerts, login prompts, or other UI that might be dismissed
17 // if (for example) an external event causes a web page to load.
18 // Overlay coordinators can be added by any coordinator in the coordinator
19 // hierarchy, but they will be children of (generally) the topmost
20 // coordinator, regardless of which coordinator added them.
21 @interface BrowserCoordinator (Internal) 11 @interface BrowserCoordinator (Internal)
22 12
23 // Managed view controller of this object. Subclasses must define a 13 // Managed view controller of this object. Subclasses must define a
24 // property named |viewController| that has the specific UIViewController 14 // property named |viewController| that has the specific UIViewController
25 // subclass they use; the subclass API will be able to access that view 15 // subclass they use; the subclass API will be able to access that view
26 // controller through this property. 16 // controller through this property.
27 @property(nonatomic, readonly) UIViewController* viewController; 17 @property(nonatomic, readonly) UIViewController* viewController;
28 18
29 // The child coordinators of this coordinator. To add or remove from this set, 19 // The child coordinators of this coordinator. To add or remove from this set,
30 // use the -addChildCoordinator: and -removeChildCoordinator: methods. 20 // use the -addChildCoordinator: and -removeChildCoordinator: methods.
31 @property(nonatomic, readonly) NSSet<BrowserCoordinator*>* children; 21 @property(nonatomic, readonly) NSSet<BrowserCoordinator*>* children;
32 22
33 // The coordinator that added this coordinator as a child, if any. 23 // The coordinator that added this coordinator as a child, if any.
34 @property(nonatomic, readonly) BrowserCoordinator* parentCoordinator; 24 @property(nonatomic, readonly) BrowserCoordinator* parentCoordinator;
35 25
36 // YES if the receiver has been started; NO (the default) otherwise. Stopping 26 // YES if the receiver has been started; NO (the default) otherwise. Stopping
37 // the receiver resets this property to NO. 27 // the receiver resets this property to NO.
38 @property(nonatomic, readonly) BOOL started; 28 @property(nonatomic, readonly) BOOL started;
39 29
40 // YES if the receiver is acting as an overlay coordinator; NO (the default)
41 // otherwise.
42 @property(nonatomic, readonly) BOOL overlaying;
43
44 // The coordinator (if any) in the coordinator hierarchy (starting with
45 // the receiver) that is overlaying. If the receiver isn't overlaying,
46 // it recursively asks its children.
47 @property(nonatomic, readonly) BrowserCoordinator* overlayCoordinator;
48
49 // Adds |coordinator| as a child, taking ownership of it, setting the receiver's 30 // Adds |coordinator| as a child, taking ownership of it, setting the receiver's
50 // viewController (if any) as the child's baseViewController, and setting 31 // viewController (if any) as the child's baseViewController, and setting
51 // the receiver's |browser| as the child's |browser|. 32 // the receiver's |browser| as the child's |browser|.
52 - (void)addChildCoordinator:(BrowserCoordinator*)childCoordinator; 33 - (void)addChildCoordinator:(BrowserCoordinator*)childCoordinator;
53 34
54 // Removes |coordinator| as a child, relinquishing ownership of it. If 35 // Removes |coordinator| as a child, relinquishing ownership of it. If
55 // |coordinator| isn't a child of the receiver, this method does nothing. 36 // |coordinator| isn't a child of the receiver, this method does nothing.
56 - (void)removeChildCoordinator:(BrowserCoordinator*)childCoordinator; 37 - (void)removeChildCoordinator:(BrowserCoordinator*)childCoordinator;
57 38
58 // Called when this coordinator is added to a parent coordinator. 39 // Called when this coordinator is added to a parent coordinator.
59 - (void)wasAddedToParentCoordinator:(BrowserCoordinator*)parentCoordinator; 40 - (void)wasAddedToParentCoordinator:(BrowserCoordinator*)parentCoordinator;
60 41
61 // Called when this coordinator is going to be removed from its parent 42 // Called when this coordinator is going to be removed from its parent
62 // coordinator. 43 // coordinator.
63 - (void)willBeRemovedFromParentCoordinator; 44 - (void)willBeRemovedFromParentCoordinator;
64 45
65 // Called when a child coordinator did start. This is a blank template method. 46 // Called when a child coordinator did start. This is a blank template method.
66 // Subclasses can override this method when they need to know when their 47 // Subclasses can override this method when they need to know when their
67 // children start. 48 // children start.
68 - (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator; 49 - (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator;
69 50
70 // Called when a child coordinator will stop. This is a blank template method. 51 // Called when a child coordinator will stop. This is a blank template method.
71 // Subclasses can override this method when they need to know when their 52 // Subclasses can override this method when they need to know when their
72 // children start. 53 // children start.
73 - (void)childCoordinatorWillStop:(BrowserCoordinator*)childCoordinator; 54 - (void)childCoordinatorWillStop:(BrowserCoordinator*)childCoordinator;
74 55
75 // Methods for adding overlay coordinators.
76
77 // Returns YES if the receiver will take |overlayCoordinator| as a child.
78 // The default is to return YES only if the receiver has no children, if
79 // the receiver has a nil -overlayCoordinator, and if |overlayCoordinator|
80 // is not already overlaying.
81 - (BOOL)canAddOverlayCoordinator:(BrowserCoordinator*)overlayCoordinator;
82
83 // Adds |overlayCoordinator| as a child to the receiver, or if it cannot be
84 // added, recursively add it to the receiver's child. If a receiver has
85 // multiple children and returns YES from -canAddOverlayCoordinator:, it
86 // must override this method to determines how the overlay is added.
87 // If neither the receiver or any child can add |overlayCoordinator|, then
88 // nothing happens.
89 - (void)addOverlayCoordinator:(BrowserCoordinator*)overlayCoordinator;
90
91 // Removes the current overlay coordinator (if any) as a child from its
92 // parent.
93 - (void)removeOverlayCoordinator;
94
95 @end 56 @end
96 57
97 #endif // IOS_SHARED_CHROME_BROWSER_UI_COORDINATORS_BROWSER_COORDINATOR_INTERNA L_H_ 58 #endif // IOS_SHARED_CHROME_BROWSER_UI_COORDINATORS_BROWSER_COORDINATOR_INTERNA L_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698