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

Unified Diff: ios/web/public/javascript_dialog_presenter.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: Cleanup. 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
Index: ios/web/public/javascript_dialog_presenter.h
diff --git a/ios/web/public/javascript_dialog_presenter.h b/ios/web/public/javascript_dialog_presenter.h
new file mode 100644
index 0000000000000000000000000000000000000000..7b34ba6727f52895bc153abc5d8efda6324161bb
--- /dev/null
+++ b/ios/web/public/javascript_dialog_presenter.h
@@ -0,0 +1,35 @@
+// Copyright 2016 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_WEB_PUBLIC_JAVASCRIPT_DIALOG_PRESENTER_H_
+#define IOS_WEB_PUBLIC_JAVASCRIPT_DIALOG_PRESENTER_H_
+
+#include "ios/web/public/javascript_dialog_callback.h"
+#include "ios/web/public/javascript_dialog_type.h"
+#include "url/gurl.h"
+
+@class NSString;
+
+namespace web {
+
+class WebState;
+
+class JavaScriptDialogPresenter {
+ public:
+ // Requests presentation of a JavaScript dialog. Clients must always call
+ // |callback| even if they choose not to present the dialog.
+ virtual void RunJavaScriptDialog(WebState* web_state,
+ const GURL& origin,
+ JavaScriptDialogType javascript_dialog_type,
Eugene But (OOO till 7-30) 2016/06/27 21:09:37 NIT: s/java_script_dialog_type/javascript_dialog_t
michaeldo 2016/06/27 22:25:10 Done.
+ NSString* message_text,
+ NSString* default_prompt_text,
+ const DialogClosedCallback& callback) = 0;
+ // Cancels the display of any currently displayed dialog and any queued
Eugene But (OOO till 7-30) 2016/06/27 21:09:37 Please do not assume that clients queue these dial
michaeldo 2016/06/27 22:25:10 Done.
+ // dialogs associated with |web_state|.
+ virtual void CancelActiveAndPendingDialogs(WebState* web_state) = 0;
+};
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_JAVASCRIPT_DIALOG_PRESENTER_H_

Powered by Google App Engine
This is Rietveld 408576698