public override bool OnContextMenuCommand(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
        {
            var webBrowser = (ChromiumWebBrowser)chromiumWebBrowser;

            var linkUrl       = parameters.LinkUrl;
            var selectionText = parameters.SelectionText;

            switch (commandId)
            {
            case CefMenuCommand.ViewSource:
            {
                webBrowser.Invoke(new Action(() =>
                    {
                        ViewSourceWindow.Show(webBrowser.Address);
                    }));
                return(true);
            }

            case Search:
            {
                webBrowser.Invoke(new Action(() =>
                    {
                        BrowserWindow.Show(SearchEngineUtil.GetUrl(selectionText, GlobalData.Settings.SearchEngine));
                    }));
                return(true);
            }

            case OpenInNewWindow:
            {
                webBrowser.Invoke(new Action(() =>
                    {
                        BrowserWindow.Show(linkUrl);
                    }));
                return(true);
            }

            default:
            {
                return(false);
            }
            }
        }
        private void OpenUrl(string url)
        {
            if (string.IsNullOrWhiteSpace(url))
            {
                JsAlertDialog.ShowDialog(LanguageManager.GetString("message_emptyUrl"));
                return;
            }

            url = url.Trim();

            if (UrlChecker.IsLocalSwfFile(url))
            {
                SwfPlayerWindow.Show(url);
                return;
            }

            switch (GlobalData.Settings.NavigationType)
            {
            case NavigationType.Automatic:
            {
                if (!UrlChecker.IsHttpUrl(url))
                {
                    url = SearchEngineUtil.GetUrl(url, GlobalData.Settings.SearchEngine);
                }
            }
            break;

            case NavigationType.SearchOnly:
            {
                url = SearchEngineUtil.GetUrl(url, GlobalData.Settings.SearchEngine);
            }
            break;

            case NavigationType.NavigateOnly:
            {
                //nothing to do
            }
            break;
            }

            BrowserWindow.Show(url);
        }