Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/web_java_script_dialog_presenter.h |
| diff --git a/ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/web_java_script_dialog_presenter.h b/ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/web_java_script_dialog_presenter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..677a4ee995b5376545b361e388d946e129b433af |
| --- /dev/null |
| +++ b/ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/web_java_script_dialog_presenter.h |
| @@ -0,0 +1,42 @@ |
| +// 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_DIALOGS_JAVA_SCRIPT_WEB_JAVA_SCRIPT_DIALOG_PRESENTER_H_ |
| +#define IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_JAVA_SCRIPT_WEB_JAVA_SCRIPT_DIALOG_PRESENTER_H_ |
| + |
| +#import <Foundation/Foundation.h> |
| + |
| +#include "ios/web/public/java_script_dialog_presenter.h" |
| +#import "ios/web/public/web_state/web_state_user_data.h" |
| + |
| +// A concrete subclass of web::JavaScriptDialogPresenter that is associated with |
| +// a WebState via its UserData. |
| +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
|
| + : public web::JavaScriptDialogPresenter, |
| + public web::WebStateUserData<WebJavaScriptDialogPresenter> { |
| + public: |
| + ~WebJavaScriptDialogPresenter() override; |
| + |
| + private: |
| + friend class web::WebStateUserData<WebJavaScriptDialogPresenter>; |
| + // The WebState with which this presenter is associated. |
| + web::WebState* web_state_; |
| + |
| + // Private constructor. New instances should be created via |
| + // CreateForWebState() and accessed via FromWebState(). |
| + explicit WebJavaScriptDialogPresenter(web::WebState* web_state); |
| + |
| + // JavaScriptDialogPresenter: |
| + void RunJavaScriptDialog(web::WebState* web_state, |
| + const GURL& origin_url, |
| + web::JavaScriptDialogType dialog_type, |
| + NSString* message_text, |
| + NSString* default_prompt_text, |
| + const web::DialogClosedCallback& callback) override; |
| + void CancelDialogs(web::WebState* web_state) override; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebJavaScriptDialogPresenter); |
| +}; |
| + |
| +#endif // IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_JAVA_SCRIPT_WEB_JAVA_SCRIPT_DIALOG_PRESENTER_H_ |