SEBWIN-220: Removed custom scheme handling and added fancy icon to password dialog.
This commit is contained in:
parent
f8e5a4bedf
commit
420ed1fc18
4 changed files with 17 additions and 38 deletions
|
@ -10,7 +10,6 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using CefSharp;
|
using CefSharp;
|
||||||
using SafeExamBrowser.Browser.Handlers;
|
|
||||||
using SafeExamBrowser.Contracts.Browser;
|
using SafeExamBrowser.Contracts.Browser;
|
||||||
using SafeExamBrowser.Contracts.Configuration;
|
using SafeExamBrowser.Contracts.Configuration;
|
||||||
using SafeExamBrowser.Contracts.I18n;
|
using SafeExamBrowser.Contracts.I18n;
|
||||||
|
@ -103,9 +102,6 @@ namespace SafeExamBrowser.Browser
|
||||||
LogSeverity = LogSeverity.Info
|
LogSeverity = LogSeverity.Info
|
||||||
};
|
};
|
||||||
|
|
||||||
cefSettings.RegisterScheme(new CefCustomScheme { SchemeName = "seb", SchemeHandlerFactory = new SchemeHandlerFactory() });
|
|
||||||
cefSettings.RegisterScheme(new CefCustomScheme { SchemeName = "sebs", SchemeHandlerFactory = new SchemeHandlerFactory() });
|
|
||||||
|
|
||||||
return cefSettings;
|
return cefSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2018 ETH Zürich, Educational Development and Technology (LET)
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
using CefSharp;
|
|
||||||
|
|
||||||
namespace SafeExamBrowser.Browser.Handlers
|
|
||||||
{
|
|
||||||
/// <remarks>
|
|
||||||
/// See https://cefsharp.github.io/api/63.0.0/html/T_CefSharp_ISchemeHandlerFactory.htm.
|
|
||||||
/// </remarks>
|
|
||||||
internal class SchemeHandlerFactory : ISchemeHandlerFactory
|
|
||||||
{
|
|
||||||
public IResourceHandler Create(IBrowser browser, IFrame frame, string schemeName, IRequest request)
|
|
||||||
{
|
|
||||||
var page = @"<html><body style=""height: 90%; display: flex; align-items: center; justify-content: center""><progress /></body></html>";
|
|
||||||
var handler = ResourceHandler.FromString(page);
|
|
||||||
|
|
||||||
return handler;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -73,7 +73,6 @@
|
||||||
<Compile Include="Handlers\DownloadHandler.cs" />
|
<Compile Include="Handlers\DownloadHandler.cs" />
|
||||||
<Compile Include="Handlers\KeyboardHandler.cs" />
|
<Compile Include="Handlers\KeyboardHandler.cs" />
|
||||||
<Compile Include="Handlers\RequestHandler.cs" />
|
<Compile Include="Handlers\RequestHandler.cs" />
|
||||||
<Compile Include="Handlers\SchemeHandlerFactory.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:fa="http://schemas.fontawesome.io/icons/"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:SafeExamBrowser.UserInterface.Classic"
|
xmlns:local="clr-namespace:SafeExamBrowser.UserInterface.Classic"
|
||||||
mc:Ignorable="d" Height="200" Width="450" ResizeMode="NoResize" Topmost="True">
|
mc:Ignorable="d" Height="200" Width="450" ResizeMode="NoResize" Topmost="True">
|
||||||
|
@ -17,13 +18,22 @@
|
||||||
<RowDefinition Height="4*" />
|
<RowDefinition Height="4*" />
|
||||||
<RowDefinition Height="2*" />
|
<RowDefinition Height="2*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="0" Margin="25,0,25,25">
|
<Grid Grid.Row="0">
|
||||||
<Grid.RowDefinitions>
|
<Grid>
|
||||||
<RowDefinition Height="*" />
|
<Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.RowDefinitions>
|
<ColumnDefinition Width="*" />
|
||||||
<TextBlock Grid.Row="0" x:Name="Message" Margin="0,0,0,10" TextWrapping="WrapWithOverflow" VerticalAlignment="Bottom" />
|
</Grid.ColumnDefinitions>
|
||||||
<PasswordBox Grid.Row="1" x:Name="Password" Height="25" VerticalContentAlignment="Center" />
|
<fa:ImageAwesome Grid.Column="0" x:Name="NoAdapterIcon" Foreground="LightGray" Icon="Key" Margin="25" Rotation="90" Width="50" />
|
||||||
|
<Grid Grid.Column="1" Margin="0,0,25,25">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Grid.Row="0" x:Name="Message" Margin="0,0,0,5" TextWrapping="WrapWithOverflow" VerticalAlignment="Bottom" />
|
||||||
|
<PasswordBox Grid.Row="1" x:Name="Password" Height="25" VerticalContentAlignment="Center" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Grid.Row="1" Background="{StaticResource BackgroundBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
<Grid Grid.Row="1" Background="{StaticResource BackgroundBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||||
<WrapPanel Orientation="Horizontal" Margin="25,0" HorizontalAlignment="Right" VerticalAlignment="Center">
|
<WrapPanel Orientation="Horizontal" Margin="25,0" HorizontalAlignment="Right" VerticalAlignment="Center">
|
||||||
|
|
Loading…
Reference in a new issue