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

Side by Side Diff: ios/clean/chrome/browser/browser_coordinator.mm

Issue 2734333003: Child coordinators notify their parent upon -start and -stop. (Closed)
Patch Set: Fix tests build (they were on the "all" target) Created 3 years, 9 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 // ====== 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 #import "base/logging.h" 9 #import "base/logging.h"
10 #import "ios/clean/chrome/browser/browser_coordinator+internal.h" 10 #import "ios/clean/chrome/browser/browser_coordinator+internal.h"
(...skipping 25 matching lines...) Expand all
36 if (self = [super init]) { 36 if (self = [super init]) {
37 _context = [[CoordinatorContext alloc] init]; 37 _context = [[CoordinatorContext alloc] init];
38 _childCoordinators = [NSMutableSet set]; 38 _childCoordinators = [NSMutableSet set];
39 } 39 }
40 return self; 40 return self;
41 } 41 }
42 42
43 #pragma mark - Public API 43 #pragma mark - Public API
44 44
45 - (void)start { 45 - (void)start {
46 // Default implementation is a no-op. 46 [self.parentCoordinator childCoordinatorDidStart:self];
47 } 47 }
48 48
49 - (void)stop { 49 - (void)stop {
50 // Default implementation is a no-op. 50 [self.parentCoordinator childCoordinatorWillStop:self];
51 } 51 }
52 52
53 @end 53 @end
54 54
55 @implementation BrowserCoordinator (Internal) 55 @implementation BrowserCoordinator (Internal)
56 // Concrete implementations must implement a |viewController| property. 56 // Concrete implementations must implement a |viewController| property.
57 @dynamic viewController; 57 @dynamic viewController;
58 58
59 - (NSSet*)children { 59 - (NSSet*)children {
60 return [self.childCoordinators copy]; 60 return [self.childCoordinators copy];
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 self.childCoordinators.count == 0; 115 self.childCoordinators.count == 0;
116 } 116 }
117 117
118 - (void)removeChildCoordinator:(BrowserCoordinator*)coordinator { 118 - (void)removeChildCoordinator:(BrowserCoordinator*)coordinator {
119 if (![self.childCoordinators containsObject:coordinator]) 119 if (![self.childCoordinators containsObject:coordinator])
120 return; 120 return;
121 [self.childCoordinators removeObject:coordinator]; 121 [self.childCoordinators removeObject:coordinator];
122 coordinator.parentCoordinator = nil; 122 coordinator.parentCoordinator = nil;
123 } 123 }
124 124
125 - (void)childCoordinatorDidStart:(BrowserCoordinator*)coordinator {
126 // Default implementation is a no-op.
127 }
128
129 - (void)childCoordinatorWillStop:(BrowserCoordinator*)coordinator {
130 // Default implementation is a no-op.
131 }
132
125 @end 133 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698