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/web_state_overlay_queue.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator.h" |
| 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." |
| 12 #endif |
| 13 |
| 14 DEFINE_WEB_STATE_USER_DATA_KEY(WebStateOverlayQueue); |
| 15 |
| 16 WebStateOverlayQueue::WebStateOverlayQueue(web::WebState* web_state) |
| 17 : web_state_(web_state), parent_coordinator_(nil) { |
| 18 DCHECK(web_state); |
| 19 } |
| 20 |
| 21 web::WebState* WebStateOverlayQueue::GetWebState() const { |
| 22 return web_state_; |
| 23 } |
| 24 |
| 25 void WebStateOverlayQueue::StartNextOverlay() { |
| 26 DCHECK(parent_coordinator_); |
| 27 DCHECK(HasQueuedOverlays()); |
| 28 DCHECK(!IsShowingOverlay()); |
| 29 [GetFirstOverlay() startOverlayingCoordinator:parent_coordinator_]; |
| 30 OverlayWasStarted(); |
| 31 } |
| 32 |
| 33 void WebStateOverlayQueue::AddWebStateOverlay( |
| 34 BrowserCoordinator* overlay_coordinator) { |
| 35 AddOverlay(overlay_coordinator); |
| 36 } |
| 37 |
| 38 void WebStateOverlayQueue::SetWebStateParentCoordinator( |
| 39 BrowserCoordinator* parent_coordinator) { |
| 40 parent_coordinator_ = parent_coordinator; |
| 41 } |
OLD | NEW |