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

Side by Side Diff: ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/web_java_script_dialog_presenter.h

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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_JAVA_SCRIPT_WEB_JAVA_SCRIPT_DIALOG_P RESENTER_H_
6 #define IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_JAVA_SCRIPT_WEB_JAVA_SCRIPT_DIALOG_P RESENTER_H_
7
8 #import <Foundation/Foundation.h>
9
10 #include "ios/web/public/java_script_dialog_presenter.h"
11 #import "ios/web/public/web_state/web_state_user_data.h"
12
13 // A concrete subclass of web::JavaScriptDialogPresenter that is associated with
14 // a WebState via its UserData.
15 class WebJavaScriptDialogPresenter
marq (ping after 24h) 2017/06/14 11:28:39 I suspect naming this "WebFoo" when it isn't in io
kkhorimoto 2017/06/23 06:34:03 I'm also not a fan. I renamed it to JavaScriptDial
16 : public web::JavaScriptDialogPresenter,
17 public web::WebStateUserData<WebJavaScriptDialogPresenter> {
18 public:
19 ~WebJavaScriptDialogPresenter() override;
20
21 private:
22 friend class web::WebStateUserData<WebJavaScriptDialogPresenter>;
23 // The WebState with which this presenter is associated.
24 web::WebState* web_state_;
25
26 // Private constructor. New instances should be created via
27 // CreateForWebState() and accessed via FromWebState().
28 explicit WebJavaScriptDialogPresenter(web::WebState* web_state);
29
30 // JavaScriptDialogPresenter:
31 void RunJavaScriptDialog(web::WebState* web_state,
32 const GURL& origin_url,
33 web::JavaScriptDialogType dialog_type,
34 NSString* message_text,
35 NSString* default_prompt_text,
36 const web::DialogClosedCallback& callback) override;
37 void CancelDialogs(web::WebState* web_state) override;
38
39 DISALLOW_COPY_AND_ASSIGN(WebJavaScriptDialogPresenter);
40 };
41
42 #endif // IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_JAVA_SCRIPT_WEB_JAVA_SCRIPT_DIALO G_PRESENTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698