Skip to content

Commit

Permalink
[create-pull-request] automated change (#7506)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed May 26, 2022
1 parent a35b985 commit 3409e87
Show file tree
Hide file tree
Showing 240 changed files with 923 additions and 891 deletions.
2 changes: 1 addition & 1 deletion src/BlazorWebView/src/Maui/Tizen/WebViewContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
/// </summary>
public class WebViewContainer : WidgetLayout
{

/// <summary>
/// A Tizen WebView.
/// </summary>
Expand Down
36 changes: 18 additions & 18 deletions src/BlazorWebView/src/Maui/Tizen/WebViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
/// <summary>
/// WebViewExtension
/// </summary>
internal static class WebViewExtensions
{
public const string ChromiumEwk = "libchromium-ewk.so";
internal static class WebViewExtensions
{
public const string ChromiumEwk = "libchromium-ewk.so";

public static void SetInterceptRequestCallback(this TWebView webView, InterceptRequestCallback callback)
{
public static void SetInterceptRequestCallback(this TWebView webView, InterceptRequestCallback callback)
{
var context = webView.GetContext();
var handleField = context.GetType().GetField("_handle", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
var contextHandle = (IntPtr?)handleField?.GetValue(context);
var contextHandle = (IntPtr?)handleField?.GetValue(context);
if (contextHandle != null)
ewk_context_intercept_request_callback_set(contextHandle.Value, callback, IntPtr.Zero);
}
}

public static void SetInspectorStart(this TWebView webView, uint port)
{
Expand All @@ -30,27 +30,27 @@ public static void SetInspectorStart(this TWebView webView, uint port)
}

public static bool SetInterceptRequestResponse(this TWebView webView, IntPtr request, string header, byte[] body, uint length)
{
return ewk_intercept_request_response_set(request, header, body, length);
}
{
return ewk_intercept_request_response_set(request, header, body, length);
}

public static bool IgnoreInterceptRequest(this TWebView webView, IntPtr request)
{
return ewk_intercept_request_ignore(request);
}
{
return ewk_intercept_request_ignore(request);
}

public static string GetInterceptRequestUrl(this TWebView webView, IntPtr request)
{
return Marshal.PtrToStringAnsi(_ewk_intercept_request_url_get(request)) ?? string.Empty;
}
}

[DllImport(ChromiumEwk)]
[DllImport(ChromiumEwk)]
internal static extern IntPtr ewk_view_context_get(IntPtr obj);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void InterceptRequestCallback(IntPtr context, IntPtr request, IntPtr userData);
public delegate void InterceptRequestCallback(IntPtr context, IntPtr request, IntPtr userData);

[DllImport(ChromiumEwk)]
[DllImport(ChromiumEwk)]
internal static extern void ewk_context_intercept_request_callback_set(IntPtr context, InterceptRequestCallback callback, IntPtr userData);

[DllImport(ChromiumEwk, EntryPoint = "ewk_intercept_request_url_get")]
Expand All @@ -62,7 +62,7 @@ public static string GetInterceptRequestUrl(this TWebView webView, IntPtr reques
internal static string ewk_intercept_request_http_method_get(IntPtr request)
{
return Marshal.PtrToStringAnsi(_ewk_intercept_request_http_method_get(request)) ?? string.Empty;
}
}

[DllImport(ChromiumEwk)]
public static extern uint ewk_context_inspector_server_start(IntPtr context, uint port);
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorWebView/src/Maui/Windows/WinUIWebViewManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected override async Task HandleWebResourceRequest(CoreWebView2WebResourceRe
await stream.WriteAsync(memStream.GetWindowsRuntimeBuffer());
}
}

var hotReloadedContent = Stream.Null;
if (StaticContentHotReloadManager.TryReplaceResponseContent(_contentRootRelativeToAppRoot, requestUri, ref statusCode, ref hotReloadedContent, headers))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
#endif
{
internal class BlazorWebViewDeveloperTools
{
public bool Enabled { get; set; } = false;
}
{
public bool Enabled { get; set; } = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ public static IMauiBlazorWebViewBuilder AddMauiBlazorWebView(this IServiceCollec
#endif
}

/// <summary>
/// Enables Developer tools on the underlying WebView controls.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/>.</param>
/// <returns>The <see cref="IServiceCollection"/>.</returns>
public static IServiceCollection AddBlazorWebViewDeveloperTools(this IServiceCollection services)
{
return services.AddSingleton<BlazorWebViewDeveloperTools>(new BlazorWebViewDeveloperTools { Enabled = true });
}
/// <summary>
/// Enables Developer tools on the underlying WebView controls.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/>.</param>
/// <returns>The <see cref="IServiceCollection"/>.</returns>
public static IServiceCollection AddBlazorWebViewDeveloperTools(this IServiceCollection services)
{
return services.AddSingleton<BlazorWebViewDeveloperTools>(new BlazorWebViewDeveloperTools { Enabled = true });
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.Maui.MauiBlazorWebView.DeviceTests
public partial class HandlerTestBase
{
protected bool GetIsAccessibilityElement(IViewHandler viewHandler) =>
((AccessibilityView)((DependencyObject)viewHandler.PlatformView).GetValue(NativeAutomationProperties.AccessibilityViewProperty))
((AccessibilityView)((DependencyObject)viewHandler.PlatformView).GetValue(NativeAutomationProperties.AccessibilityViewProperty))
== AccessibilityView.Content;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ protected override void OnCreate(Bundle bundle)

Forms.Init(this, null);

SetContentView (Resource.Layout.Main);
SetContentView(Resource.Layout.Main);

var ft = SupportFragmentManager.BeginTransaction();
ft.Replace(Resource.Id.fragment_frame_layout, new MainFragment(), "main");
ft.Commit();
Expand All @@ -54,7 +54,7 @@ public void ShowWebView()
{
if (_webview == null)
{
_webview= new WebViewExample().CreateSupportFragment(this);
_webview = new WebViewExample().CreateSupportFragment(this);
}

ShowEmbeddedPageFragment(_webview);
Expand All @@ -66,12 +66,12 @@ public void ShowOpenUri()
_openUri = new OpenUri().CreateSupportFragment(this);
}

ShowEmbeddedPageFragment(_openUri );
ShowEmbeddedPageFragment(_openUri);
}

public void ShowAlertsAndActionSheets()
{
if (_alertsAndActionSheets== null)
if (_alertsAndActionSheets == null)
{
_alertsAndActionSheets = new AlertsAndActionSheets().CreateSupportFragment(this);
}
Expand All @@ -85,7 +85,7 @@ void ShowEmbeddedPageFragment(Fragment fragment)

ft.AddToBackStack(null);
ft.Replace(Resource.Id.fragment_frame_layout, fragment, "hello");

ft.Commit();
}

Expand All @@ -99,7 +99,7 @@ public class MainFragment : Fragment
{
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var view = inflater.Inflate(Resource.Layout.MainFragment, container, false);
var view = inflater.Inflate(Resource.Layout.MainFragment, container, false);
var showEmbeddedButton = view.FindViewById<Button>(Resource.Id.showEmbeddedButton);
var showAlertsActionSheets = view.FindViewById<Button>(Resource.Id.showAlertsActionSheets);
var showWebView = view.FindViewById<Button>(Resource.Id.showWebView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

SetContentView (Resource.Layout.Second);
SetContentView(Resource.Layout.Second);

var ft = SupportFragmentManager.BeginTransaction();
ft.Replace(Resource.Id.fragment_frame_layout, new SecondFragment(), "main");
ft.Commit();
Expand All @@ -42,7 +42,7 @@ void ShowEmbeddedPageFragment(Fragment fragment)

ft.AddToBackStack(null);
ft.Replace(Resource.Id.fragment_frame_layout, fragment, "hello");

ft.Commit();
}

Expand All @@ -58,7 +58,7 @@ public void ShowHello()

public void ShowAlertsAndActionSheets()
{
if (_alertsAndActionSheets== null)
if (_alertsAndActionSheets == null)
{
_alertsAndActionSheets = new AlertsAndActionSheets().CreateSupportFragment(this);
}
Expand All @@ -73,15 +73,15 @@ public void ShowOpenUri()
_openUri = new OpenUri().CreateSupportFragment(this);
}

ShowEmbeddedPageFragment(_openUri );
ShowEmbeddedPageFragment(_openUri);
}
}

public class SecondFragment : Fragment
{
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var view = inflater.Inflate(Resource.Layout.SecondFragment, container, false);
var view = inflater.Inflate(Resource.Layout.SecondFragment, container, false);
var showEmbeddedButton = view.FindViewById<Button>(Resource.Id.showEmbeddedButton);
var showAlertsActionSheets = view.FindViewById<Button>(Resource.Id.showAlertsActionSheets);
var showOpenUri = view.FindViewById<Button>(Resource.Id.showOpenUri);
Expand Down
Loading

0 comments on commit 3409e87

Please sign in to comment.