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