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

Unified Diff: ios/web/web_state/web_state_impl.h

Issue 2074733002: Add public API for handling Javascript alerts and prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace BOOL with bool in unittest. Created 4 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
« no previous file with comments | « ios/web/web_state/web_state_delegate_stub.mm ('k') | ios/web/web_state/web_state_impl.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/web_state_impl.h
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h
index 776416c8e6baf81801535d5ca304b9a8be403ef4..521560bea74fb9775a1012997e1ffad30cd88318 100644
--- a/ios/web/web_state/web_state_impl.h
+++ b/ios/web/web_state/web_state_impl.h
@@ -20,6 +20,8 @@
#include "ios/web/navigation/navigation_manager_delegate.h"
#include "ios/web/navigation/navigation_manager_impl.h"
#include "ios/web/net/request_tracker_impl.h"
+#import "ios/web/public/java_script_dialog_callback.h"
+#include "ios/web/public/java_script_dialog_type.h"
#include "ios/web/public/web_state/web_state.h"
#include "url/gurl.h"
@@ -267,6 +269,16 @@ class WebStateImpl : public WebState, public NavigationManagerDelegate {
// Notifies the delegate that a context menu needs handling.
bool HandleContextMenu(const ContextMenuParams& params);
+ // Notifies the delegate that a JavaScript dialog needs to be presented.
+ void RunJavaScriptDialog(const GURL& origin_url,
+ JavaScriptDialogType java_script_dialog_type,
+ NSString* message_text,
+ NSString* default_prompt_text,
+ const DialogClosedCallback& callback);
+
+ // Cancels all dialogs associated with this web_state.
+ void CancelActiveAndPendingDialogs();
+
// NavigationManagerDelegate:
void NavigateToPendingEntry() override;
void LoadURLWithParams(const NavigationManager::WebLoadParams&) override;
« no previous file with comments | « ios/web/web_state/web_state_delegate_stub.mm ('k') | ios/web/web_state/web_state_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698