Ejemplo n.º 1
0
        /// <summary>
        /// Sets the loading state change.
        /// </summary>
        /// <param name="args">The <see cref="LoadingStateChangedEventArgs"/> instance containing the event data.</param>
        void IWebBrowserInternal.SetLoadingStateChange(LoadingStateChangedEventArgs args)
        {
            CanGoBack    = args.CanGoBack;
            CanGoForward = args.CanGoForward;
            IsLoading    = args.IsLoading;

            if (removeExNoActivateStyle && browser != null)
            {
                removeExNoActivateStyle = false;

                var host = this.GetBrowserHost();
                var hwnd = host.GetWindowHandle();
                //Remove the WS_EX_NOACTIVATE style so that future mouse clicks inside the
                //browser correctly activate and focus the browser.
                //https://github.com/chromiumembedded/cef/blob/9df4a54308a88fd80c5774d91c62da35afb5fd1b/tests/cefclient/browser/root_window_win.cc#L1088
                NativeMethodWrapper.RemoveExNoActivateStyle(hwnd);
            }

            var handler = LoadingStateChanged;

            if (handler != null)
            {
                handler(this, args);
            }
        }