Index: ios/clean/chrome/browser/ui/overlay_service/browser_coordinator+overlay_support.h |
diff --git a/ios/clean/chrome/browser/ui/overlay_service/browser_coordinator+overlay_support.h b/ios/clean/chrome/browser/ui/overlay_service/browser_coordinator+overlay_support.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4e16124d3add3f1631e3e6095effadaadc594da1 |
--- /dev/null |
+++ b/ios/clean/chrome/browser/ui/overlay_service/browser_coordinator+overlay_support.h |
@@ -0,0 +1,50 @@ |
+// 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" |
+ |
+class OverlayQueue; |
+class OverlayService; |
+ |
+// Interface exposing functionality to support being displayed via |
+// OverlayService. |
+@interface BrowserCoordinator (OverlaySupport) |
+ |
+// Returns the OverlayService associated with the receiver's BrowserState. |
+@property(nonatomic, readonly) OverlayService* overlayService; |
+ |
+// Whether this BrowserCoordinator supports overlaying. Defaults to NO. If NO, |
+// it cannot be presented via OverlayService. If YES, the coordinator is |
+// expected to: |
+// - call |-overlayWasStopped| from its |-stop| so that the OverlayService can |
marq (ping after 24h)
2017/06/23 10:42:01
It seems like these things could be guaranteed in
|
+// show the next overlay, |
+// - implement the |overlayQueue| property. |
+@property(nonatomic, readonly) BOOL supportsOverlaying; |
+ |
+// The queue used to present this overlay. |
+@property(nonatomic, assign) OverlayQueue* overlayQueue; |
+ |
+// Starts overlaying this coordinator over |overlayParent|. The receiver will |
+// be added as a child of |overlayParent|. |
+- (void)startOverlayingCoordinator:(BrowserCoordinator*)overlayParent; |
+ |
+// Called when the overlay is stopped so that the OverlayService can be |
+// notified. This function also removes the receiver as a child from its parent |
+// coordinator. |
+- (void)overlayWasStopped; |
marq (ping after 24h)
2017/06/23 10:42:01
yeah, I'd rather have an OverlayCoordinator class
|
+ |
+// Performs cleanup tasks for the overlay. This allows for deterministic |
+// cleanup to occur for coordinators whose UI has not been started. Rather than |
+// relying on |-dealloc| to perform cleanup, |-cancelOverlay| can be used to |
+// perform cleanup tasks deterministically. |
+- (void)cancelOverlay; |
+ |
+@end |
+ |
+#endif // IOS_CLEAN_CHROME_BROWSER_UI_OVERLAYS_WEB_OVERLAY_COORDINATOR_H_ |