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

Unified Diff: ios/clean/chrome/browser/ui/overlays/overlay_coordinator.h

Issue 2921833002: [iOS Clean] Created OverlayService.
Patch Set: Cancel overlays on queue deallocation Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ios/clean/chrome/browser/ui/overlays/overlay_coordinator.h
diff --git a/ios/clean/chrome/browser/ui/overlays/overlay_coordinator.h b/ios/clean/chrome/browser/ui/overlays/overlay_coordinator.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc3caa55089a8657d1bed3646dbb3c459efa5cd3
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/overlays/overlay_coordinator.h
@@ -0,0 +1,41 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CLEAN_CHROME_BROWSER_UI_OVERLAYS_WEB_OVERLAY_COORDINATOR_H_
+#define IOS_CLEAN_CHROME_BROWSER_UI_OVERLAYS_WEB_OVERLAY_COORDINATOR_H_
+
+#import <Foundation/Foundation.h>
+
+#import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator.h"
+
+namespace web {
+class WebState;
+}
+
+// OverlayCoordinators are queued on a per-WebState basis using OverlayQueue.
+// OverlayScheduler manages switching the foreground tab so that the next
+// WebState with a queued overlay is visible.
+@interface OverlayCoordinator : BrowserCoordinator
+
+// Designated initializer. |webState| is used to for OverlaySchedulerCommands.
+- (instancetype)initWithWebState:(web::WebState*)webState
+ NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
+
+// The WebState presenting this overlay.
+@property(nonatomic, readonly) web::WebState* webState;
+
+// Starts this overlay over |coordinator|'s UI. |coordinator| is expected to be
+// displaying the content view of the overlay's corresponding WebState.
+- (void)startOverlayingCoordinator:(BrowserCoordinator*)coordinator;
+
+// Performs cleanup tasks for the overlay. If a WebState is destroyed before its
+// queued overlays are presented, the overlays are removed from the queue.
+// Rather than relying on |-dealloc| to perform cleanup, |-cancelOverlay| can be
+// used to perform cleanup tasks deterministically.
+- (void)cancelOverlay;
marq (ping after 24h) 2017/06/14 10:02:32 How is this different from -stop?
kkhorimoto 2017/06/15 08:26:28 It's possible for these coordinators to be cancell
+
+@end
+
+#endif // IOS_CLEAN_CHROME_BROWSER_UI_OVERLAYS_WEB_OVERLAY_COORDINATOR_H_

Powered by Google App Engine
This is Rietveld 408576698