Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[housekeeping] Automated PR to fix formatting errors #7506

Merged
merged 1 commit into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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