Esempio n. 1
0
 private void CheckMediaDisabledFlags()
 {
     if (SafeSecurityHelper.IsFeatureDisabled(SafeSecurityHelper.KeyToRead.MediaAudioOrVideoDisable))
     {
         // in case the registry key is '1' then demand
         //Demand media permission here for Video or Audio
         // Issue: 1232606 need to fix once clr has the media permissions
         SecurityHelper.DemandMediaPermission(MediaPermissionAudio.AllAudio,
                                              MediaPermissionVideo.AllVideo,
                                              MediaPermissionImage.NoImage);
     }
 }
 private static void EnsureScriptInteropAllowed()
 {
     if (BrowserInteropHelper._isScriptInteropDisabled.Value == null)
     {
         BrowserInteropHelper._isScriptInteropDisabled.Value = new bool?(SafeSecurityHelper.IsFeatureDisabled(SafeSecurityHelper.KeyToRead.ScriptInteropDisable));
     }
     if (BrowserInteropHelper._isScriptInteropDisabled.Value.Value)
     {
         SecurityHelper.DemandWebBrowserPermission();
         return;
     }
     new WebBrowserPermission(WebBrowserPermissionLevel.Safe).Demand();
 }
Esempio n. 3
0
 public WebBrowser() : base(new Guid("8856f961-340a-11d0-a96b-00c04fd705a2"), true)
 {
     if (SafeSecurityHelper.IsFeatureDisabled(SafeSecurityHelper.KeyToRead.WebBrowserDisable))
     {
         SecurityHelper.DemandWebBrowserPermission();
     }
     else
     {
         new WebBrowserPermission(WebBrowserPermissionLevel.Safe).Demand();
     }
     if (WebBrowser.IsWebOCPermissionRestricted)
     {
         base.Loaded += this.LoadedHandler;
     }
     this._hostingAdaptor = (WebBrowser.IsWebOCHostedInBrowserProcess ? new WebBrowser.WebOCHostedInBrowserAdaptor(this) : new WebBrowser.WebOCHostingAdaptor(this));
 }