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

Unified Diff: ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm

Issue 2928723002: [iOS Clean] Added JavaScript dialog support.
Patch Set: rebased, subclassed DialogMediator 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/web_contents/web_coordinator.mm
diff --git a/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm b/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
index 8275a7fc17c5f9c81fd04d7da1b78ac2ad5c5d68..bb9a2b89250f250c61b1c82b55666ddda6a7a8ad 100644
--- a/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
+++ b/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
@@ -10,6 +10,7 @@
#import "ios/clean/chrome/browser/ui/commands/overlay_commands.h"
#import "ios/clean/chrome/browser/ui/context_menu/context_menu_context_impl.h"
#import "ios/clean/chrome/browser/ui/context_menu/web_context_menu_coordinator.h"
+#import "ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/web_java_script_dialog_presenter.h"
#import "ios/clean/chrome/browser/ui/overlays/overlay_queue.h"
#import "ios/clean/chrome/browser/ui/web_contents/web_contents_mediator.h"
#import "ios/clean/chrome/browser/ui/web_contents/web_contents_view_controller.h"
@@ -123,6 +124,12 @@ - (void)openContextMenuImage:(ContextMenuContext*)context {
#pragma mark - CRWWebStateDelegate
+- (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState:
+ (web::WebState*)webState {
+ [self createDialogHelpers];
+ return WebJavaScriptDialogPresenter::FromWebState(webState);
+}
+
- (BOOL)webState:(web::WebState*)webState
handleContextMenu:(const web::ContextMenuParams&)params {
ContextMenuContextImpl* context =
@@ -147,6 +154,7 @@ - (void)createDialogHelpers {
id<OverlaySchedulerCommands> overlayDispatcher =
static_cast<id<OverlaySchedulerCommands>>(self.browser->dispatcher());
OverlayQueue::CreateForWebState(self.webState, overlayDispatcher);
+ WebJavaScriptDialogPresenter::CreateForWebState(self.webState);
marq (ping after 24h) 2017/06/14 11:28:39 This implies the presenter will be created when an
kkhorimoto 2017/06/23 06:34:03 This function doesn't exist anymore since the Over
}
- (void)startNextOverlay {

Powered by Google App Engine
This is Rietveld 408576698