Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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 #import "ios/clean/chrome/browser/ui/overlays/overlay_coordinator.h" | |
| 6 | |
| 7 #import "base/logging.h" | |
| 8 #import "ios/clean/chrome/browser/ui/commands/overlay_commands.h" | |
| 9 #import "ios/clean/chrome/browser/ui/overlays/overlay_queue.h" | |
| 10 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" | |
| 11 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h" | |
| 12 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal. h" | |
| 13 #import "ios/web/public/web_state/web_state.h" | |
| 14 | |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
| 16 #error "This file requires ARC support." | |
| 17 #endif | |
| 18 | |
| 19 @implementation OverlayCoordinator | |
| 20 @synthesize webState = _webState; | |
| 21 | |
| 22 - (instancetype)initWithWebState:(web::WebState*)webState { | |
| 23 DCHECK(webState); | |
| 24 if ((self = [super init])) { | |
| 25 _webState = webState; | |
| 26 } | |
| 27 return self; | |
| 28 } | |
| 29 | |
| 30 #pragma mark - Public | |
| 31 | |
| 32 - (void)startOverlayingCoordinator:(BrowserCoordinator*)coordinator { | |
| 33 DCHECK([coordinator canAddOverlayCoordinator:self]); | |
| 34 [coordinator addOverlayCoordinator:self]; | |
|
marq (ping after 24h)
2017/06/14 10:02:32
I think we don't need both the overlay mechanism i
kkhorimoto
2017/06/15 08:26:28
Acknowledged. This patch still uses the existing
| |
| 35 [self start]; | |
| 36 } | |
| 37 | |
| 38 - (void)cancelOverlay { | |
| 39 // Implemented by subclasses. | |
|
marq (ping after 24h)
2017/06/14 10:02:32
The header needs to express that this class is int
kkhorimoto
2017/06/15 08:26:28
Done.
| |
| 40 } | |
| 41 | |
| 42 #pragma mark - BrowserCoordinator | |
| 43 | |
| 44 - (void)stop { | |
| 45 [super stop]; | |
| 46 // Stop receiving commands. | |
| 47 [self.browser->dispatcher() stopDispatchingToTarget:self]; | |
| 48 // Remove as the overlay for its parent. | |
| 49 [self.parentCoordinator removeOverlayCoordinator]; | |
| 50 // Notify the WebOverlayQueue that this coordinator has stopped so that it can | |
| 51 // be dequeued. | |
| 52 OverlayQueue::FromWebState(self.webState)->OverlayWasStopped(self); | |
| 53 } | |
| 54 | |
| 55 @end | |
| OLD | NEW |