2018-09-10 02:41:13 +02:00
|
|
|
// Copyright © 2015 The CefSharp Authors. All rights reserved.
|
2015-08-03 10:41:29 +10:00
|
|
|
//
|
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
2018-10-29 16:21:42 +10:00
|
|
|
namespace CefSharp.Example.Handlers
|
2015-01-11 13:45:27 +10:00
|
|
|
{
|
|
|
|
|
public class JsDialogHandler : IJsDialogHandler
|
|
|
|
|
{
|
2019-07-20 16:26:25 +10:00
|
|
|
bool IJsDialogHandler.OnJSDialog(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage)
|
2015-01-11 13:45:27 +10:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-20 16:26:25 +10:00
|
|
|
bool IJsDialogHandler.OnBeforeUnloadDialog(IWebBrowser chromiumWebBrowser, IBrowser browser, string message, bool isReload, IJsDialogCallback callback)
|
2015-01-11 13:45:27 +10:00
|
|
|
{
|
2018-09-25 20:56:31 +10:00
|
|
|
//Custom implementation would look something like
|
|
|
|
|
// - Create/Show dialog on UI Thread
|
|
|
|
|
// - execute callback once user has responded
|
|
|
|
|
// - callback.Continue(true);
|
|
|
|
|
// - return true
|
2015-01-11 13:45:27 +10:00
|
|
|
|
2018-09-25 20:56:31 +10:00
|
|
|
//NOTE: Returning false will trigger the default behaviour, no need to execute the callback if you return false.
|
2015-01-11 13:45:27 +10:00
|
|
|
return false;
|
|
|
|
|
}
|
2015-08-17 13:16:45 +10:00
|
|
|
|
2019-07-20 16:26:25 +10:00
|
|
|
void IJsDialogHandler.OnResetDialogState(IWebBrowser chromiumWebBrowser, IBrowser browser)
|
2015-08-17 13:16:45 +10:00
|
|
|
{
|
2018-09-10 02:41:13 +02:00
|
|
|
|
2015-08-17 13:16:45 +10:00
|
|
|
}
|
|
|
|
|
|
2019-07-20 16:26:25 +10:00
|
|
|
void IJsDialogHandler.OnDialogClosed(IWebBrowser chromiumWebBrowser, IBrowser browser)
|
2015-08-17 13:16:45 +10:00
|
|
|
{
|
2018-09-10 02:41:13 +02:00
|
|
|
|
2015-08-17 13:16:45 +10:00
|
|
|
}
|
2015-01-11 13:45:27 +10:00
|
|
|
}
|
|
|
|
|
}
|