public void BeforeApplicationWindowPopup(BeforePopupEventArgs eventArgs)
        {
            if (eventArgs == null)
            {
                Logger.Error("Unable to apply settings to popup window. EventArgs is null");
                return;
            }

            // Create pending request based on details supplied to window.open
            var options = new CreateWindowOptions {
                Id = eventArgs.TargetFrameName
            };

            if (eventArgs.PopupFeatures != null)
            {
                options.OuterBounds = new BoundsSpecification
                {
                    Left   = eventArgs.PopupFeatures.X.HasValue ? eventArgs.PopupFeatures.X.Value : double.NaN,
                    Top    = eventArgs.PopupFeatures.Y.HasValue ? eventArgs.PopupFeatures.Y.Value : double.NaN,
                    Height = eventArgs.PopupFeatures.Height.HasValue ? eventArgs.PopupFeatures.Height.Value : double.NaN,
                    Width  = eventArgs.PopupFeatures.Width.HasValue ? eventArgs.PopupFeatures.Width.Value : double.NaN
                };

                options.InitialState = "normal";
                if (eventArgs.PopupFeatures.Fullscreen)
                {
                    options.InitialState = "fullscreen";
                }

                options.Resizable = eventArgs.PopupFeatures.Resizable;
                options.Frame     = new FrameOptions {
                    Type = Application.Package.Manifest.DefaultFrameType
                };
                options.AlwaysOnTop = false;
                options.Focused     = true;
                options.Hidden      = false;
            }
            var request = new CreateWindowRequest(eventArgs.TargetUrl, options, null, eventArgs.TargetFrameName);

            lock (_pendingWindowCreations)
            {
                _pendingWindowCreations.Add(request);
            }
            eventArgs.NeedCustomPopupWindow = true;
            eventArgs.Cancel = false;
        }
 public CreateWindowRequest(
     string startUrl,
     CreateWindowOptions options,
     JavaScriptPluginCallback windowCreatedCallback,
     string id = null)
 {
     _stopwatch = AutoStopwatch.TimeIt("Creating app window");
     RequestId  = id;
     if (string.IsNullOrEmpty(id))
     {
         RequestId = Guid.NewGuid().ToString();
     }
     StartUrl = startUrl;
     Options  = options;
     if (windowCreatedCallback != null)
     {
         _callbackReference     = new WeakReference(windowCreatedCallback, true);
         _windowCreatedCallback = windowCreatedCallback;
     }
 }
        protected virtual IApplicationWindowEx CreateWindow(ICefWebBrowser browser, string startUrl, CreateWindowOptions options)
        {
            var window = CreateNewApplicationWindow();

            window.Initialize(this, browser, startUrl, Application.Package.Manifest.Name, options);
            AddWindow(window);
            return(window);
        }