OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // ====== New Architecture ===== |
| 6 // = This code is only used in the new iOS Chrome architecture. = |
| 7 // ============================================================================ |
| 8 |
| 9 #ifndef IOS_CHROME_BROWSER_BROWSER_COORDINATOR_H_ |
| 10 #define IOS_CHROME_BROWSER_BROWSER_COORDINATOR_H_ |
| 11 |
| 12 #import <UIKit/UIKit.h> |
| 13 |
| 14 namespace ios { |
| 15 class ChromeBrowserState; |
| 16 } |
| 17 |
| 18 // An object that manages a UI component via a view controller. |
| 19 // This is the public interface to this class; subclasses should also import |
| 20 // the Internal category header (browser_coordinator+internal.h). This header |
| 21 // file declares all the methods and properties a subclass must either override, |
| 22 // call, or reset. |
| 23 @interface BrowserCoordinator : NSObject |
| 24 |
| 25 // The browser state used by this coordinator and passed into any child |
| 26 // coordinators added to it. This is a weak pointer, and setting this property |
| 27 // doesn't transfer ownership of the browser state. |
| 28 @property(nonatomic, assign) ios::ChromeBrowserState* browserState; |
| 29 |
| 30 // The view controller that this coordinator will use to present its content, if |
| 31 // it is presenting content. This is not the view controller created and managed |
| 32 // by this coordinator; it should be supplied by whatever object is creating |
| 33 // this coordinator. |
| 34 @property(nonatomic, weak) UIViewController* rootViewController; |
| 35 |
| 36 // The basic lifecycle methods for coordinators are -start and -stop. These |
| 37 // are blank template methods; child classes are expected to implement them and |
| 38 // do not need to invoke the superclass methods. |
| 39 // Starts the user interaction managed by the receiver. Typical implementations |
| 40 // will create a view controller and then use |rootViewController| to present |
| 41 // it. |
| 42 - (void)start; |
| 43 |
| 44 // Stops the user interaction managed by the receiver. Called on dealloc. |
| 45 - (void)stop; |
| 46 |
| 47 @end |
| 48 |
| 49 #endif // IOS_CHROME_BROWSER_BROWSER_COORDINATOR_H_ |
OLD | NEW |