Chromium Code Reviews| Index: ios/web_view/internal/web_view_java_script_dialog_presenter.h |
| diff --git a/ios/web_view/internal/web_view_java_script_dialog_presenter.h b/ios/web_view/internal/web_view_java_script_dialog_presenter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0b1299aa9e919b3ee0a48728a65c9e74e7143cbf |
| --- /dev/null |
| +++ b/ios/web_view/internal/web_view_java_script_dialog_presenter.h |
| @@ -0,0 +1,40 @@ |
| +// 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_WEB_VIEW_INTERNAL_WEB_VIEW_JAVA_SCRIPT_DIALOG_PRESENTER_H_ |
| +#define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_JAVA_SCRIPT_DIALOG_PRESENTER_H_ |
| + |
| +#import "base/ios/weak_nsobject.h" |
| +#include "ios/web/public/java_script_dialog_presenter.h" |
| + |
| +@class CWVWebView; |
| +@protocol CWVUIDelegate; |
| + |
| +class WebViewJavaScriptDialogPresenter : public web::JavaScriptDialogPresenter { |
|
Eugene But (OOO till 7-30)
2017/02/27 18:30:52
Please add comments to all non-trirvial interfaces
michaeldo
2017/02/27 21:35:51
Done.
|
| + public: |
| + WebViewJavaScriptDialogPresenter(CWVWebView* web_view, |
| + id<CWVUIDelegate> ui_delegate); |
| + ~WebViewJavaScriptDialogPresenter(); |
| + |
|
Eugene But (OOO till 7-30)
2017/02/27 18:30:52
// web::JavaScriptDialogPresenter overrides:
michaeldo
2017/02/27 21:35:51
Done.
|
| + 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; |
| + |
| + void SetUIDelegate(id<CWVUIDelegate> ui_delegate); |
| + |
| + private: |
| + // The underlying delegate handling the dialog UI. |
| + base::WeakNSProtocol<id<CWVUIDelegate>> ui_delegate_; |
| + // The web view which originated the dialogs. |
| + base::WeakNSObject<CWVWebView> web_view_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebViewJavaScriptDialogPresenter); |
| +}; |
| + |
| +#endif // IOS_WEB_VIEW_INTERNAL_WEB_VIEW_JAVA_SCRIPT_DIALOG_PRESENTER_H_ |