2016-01-11 14:11:30 +10:00
|
|
|
// Copyright © 2010-2016 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.
|
|
|
|
|
|
|
|
|
|
namespace CefSharp.Example
|
2015-01-11 13:45:27 +10:00
|
|
|
{
|
|
|
|
|
public class JsDialogHandler : IJsDialogHandler
|
|
|
|
|
{
|
2016-05-30 07:57:48 +10:00
|
|
|
public bool OnJSDialog(IWebBrowser browserControl, 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;
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-11 09:45:55 +10:00
|
|
|
public bool OnJSBeforeUnload(IWebBrowser browserControl, IBrowser browser, string message, bool isReload, IJsDialogCallback callback)
|
2015-01-11 13:45:27 +10:00
|
|
|
{
|
2015-06-01 11:31:57 +10:00
|
|
|
//NOTE: No need to execute the callback if you return false
|
|
|
|
|
// callback.Continue(true);
|
2015-01-11 13:45:27 +10:00
|
|
|
|
|
|
|
|
//NOTE: Returning false will trigger the default behaviour, you need to return true to handle yourself.
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2015-08-17 13:16:45 +10:00
|
|
|
|
|
|
|
|
public void OnResetDialogState(IWebBrowser browserControl, IBrowser browser)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnDialogClosed(IWebBrowser browserControl, IBrowser browser)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2015-01-11 13:45:27 +10:00
|
|
|
}
|
|
|
|
|
}
|