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

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

Issue 2921833002: [iOS Clean] Created OverlayService.
Patch Set: Use service pattern 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/web_state_overlay_queue.h
diff --git a/ios/clean/chrome/browser/ui/overlays/web_state_overlay_queue.h b/ios/clean/chrome/browser/ui/overlays/web_state_overlay_queue.h
new file mode 100644
index 0000000000000000000000000000000000000000..1203bf863911d12eec8844b3c572e589deca2a2c
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/overlays/web_state_overlay_queue.h
@@ -0,0 +1,42 @@
+// 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_STATE_OVERLAY_QUEUE_H_
+#define IOS_CLEAN_CHROME_BROWSER_UI_OVERLAYS_WEB_STATE_OVERLAY_QUEUE_H_
+
+#import "ios/clean/chrome/browser/ui/overlays/overlay_queue.h"
+#import "ios/web/public/web_state/web_state_user_data.h"
+
+// An implementation of OverlayQueue that stores BrowserCoordinators for a
+// specific WebState.
+class WebStateOverlayQueue
+ : public OverlayQueue,
+ public web::WebStateUserData<WebStateOverlayQueue> {
+ public:
+ // OverlayQueue:
+ web::WebState* GetWebState() const override;
+ void StartNextOverlay() override;
+
+ // Adds an overlay coordinator that will be displayed over GetWebState()'s
+ // content area.
+ void AddWebStateOverlay(BrowserCoordinator* overlay_coordinator);
+ // Sets the parent coordinator to use for queued BrowserCoordinators.
+ // |parent| is expected to be displaying GetWebState()'s content area before
+ // calling this function.
+ void SetWebStateParentCoordinator(BrowserCoordinator* parent_coordinator);
+
+ private:
+ friend class web::WebStateUserData<WebStateOverlayQueue>;
+ // The WebState with which this presenter is associated.
+ web::WebState* web_state_;
+ // The parent coordinator to use for overlays.
+ BrowserCoordinator* parent_coordinator_;
marq (ping after 24h) 2017/06/21 09:41:54 _weak, I'm guessing; default would be strong.
kkhorimoto 2017/06/23 06:11:16 Done.
+
+ // Private constructor.
+ explicit WebStateOverlayQueue(web::WebState* web_state);
+
+ DISALLOW_COPY_AND_ASSIGN(WebStateOverlayQueue);
+};
+
+#endif // IOS_CLEAN_CHROME_BROWSER_UI_OVERLAYS_WEB_STATE_OVERLAY_QUEUE_H_

Powered by Google App Engine
This is Rietveld 408576698