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

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

Issue 2921833002: [iOS Clean] Created OverlayService.
Patch Set: self review Created 3 years, 7 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/web_contents/overlays/web_overlay_coordinator.h
diff --git a/ios/clean/chrome/browser/ui/web_contents/overlays/web_overlay_coordinator.h b/ios/clean/chrome/browser/ui/web_contents/overlays/web_overlay_coordinator.h
new file mode 100644
index 0000000000000000000000000000000000000000..d4df1196524b6675f287bd487e76badecb8f2684
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/web_contents/overlays/web_overlay_coordinator.h
@@ -0,0 +1,39 @@
+// 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_WEB_CONTENTS_OVERLAYS_WEB_OVERLAY_COORDINATOR_H_
+#define IOS_CLEAN_CHROME_BROWSER_UI_WEB_CONTENTS_OVERLAYS_WEB_OVERLAY_COORDINATOR_H_
+
+#import <Foundation/Foundation.h>
+
+#import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator.h"
+
+namespace web {
+class WebState;
+}
+
+// An overlay coordinator requested by a WKWebView. These coordinators own the
marq (ping after 24h) 2017/06/02 16:14:11 Nit: WKWebView is an implementation detail inside
kkhorimoto 2017/06/03 00:37:32 I've generalized this and other WebOverlay classes
+// completion handlers supplied by WebKit and are responsible for cancelling
+// them if necessary. This interface is meant to be subclassed for JavaScript
+// dialogs, HTTP authentication dialogs, etc.
+@interface WebOverlayCoordinator : BrowserCoordinator
+
+// Designated initializer. |webState| is the WebState whose WKWebView is
+// requesting the overlay.
+- (instancetype)initWithWebState:(web::WebState*)webState
+ NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
+
+// Starts this WebOverlayCoordinator over |web_coordinator|. |web_coordinator|
+// is expected to be displaying the WKWebView that requested the overlay.
+- (void)startOverlayingWebCoordinator:(BrowserCoordinator*)webCoordinator;
marq (ping after 24h) 2017/06/02 16:14:11 Wouldn't this just be this coordinator's parent?
kkhorimoto 2017/06/03 00:37:32 When this is called, there is no parent yet. All
+
+// Executes its WebKit completion handler with null parameters. WebKit
+// completion handlers throw exceptions if they are deallocated without
+// being executed.
+- (void)cancelWebKitCompletion;
marq (ping after 24h) 2017/06/02 16:14:11 This very much feels like it shouldn't be part of
kkhorimoto 2017/06/03 00:37:32 I've generalized this so that it no longer refers
+
+@end
+
+#endif // IOS_CLEAN_CHROME_BROWSER_UI_WEB_CONTENTS_OVERLAYS_WEB_OVERLAY_COORDINATOR_H_

Powered by Google App Engine
This is Rietveld 408576698