From 77b8403deb1da508e1c1894d74e3d371b3bc4ba9 Mon Sep 17 00:00:00 2001 From: "swan.seo" Date: Fri, 17 Nov 2023 15:28:00 +0900 Subject: [PATCH] Apply format Signed-off-by: swan.seo --- .../webview_flutter_test.dart | 2 - .../webview_flutter/example/lib/main.dart | 1 - .../lib/src/tizen_webview_controller.dart | 32 +++++++-------- .../tizen/src/ewk_internal_api_binding.cc | 8 ++-- packages/webview_flutter/tizen/src/webview.cc | 41 +++++++++---------- 5 files changed, 40 insertions(+), 44 deletions(-) diff --git a/packages/webview_flutter/example/integration_test/webview_flutter_test.dart b/packages/webview_flutter/example/integration_test/webview_flutter_test.dart index 1e8f990ad..8322d7adb 100644 --- a/packages/webview_flutter/example/integration_test/webview_flutter_test.dart +++ b/packages/webview_flutter/example/integration_test/webview_flutter_test.dart @@ -10,9 +10,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:webview_flutter/webview_flutter.dart'; diff --git a/packages/webview_flutter/example/lib/main.dart b/packages/webview_flutter/example/lib/main.dart index 02868508a..cdd059f42 100644 --- a/packages/webview_flutter/example/lib/main.dart +++ b/packages/webview_flutter/example/lib/main.dart @@ -104,7 +104,6 @@ const String kLogExamplePage = ''' '''; - class WebViewExample extends StatefulWidget { const WebViewExample({super.key}); diff --git a/packages/webview_flutter/lib/src/tizen_webview_controller.dart b/packages/webview_flutter/lib/src/tizen_webview_controller.dart index 120bb64dc..88a47bb9c 100644 --- a/packages/webview_flutter/lib/src/tizen_webview_controller.dart +++ b/packages/webview_flutter/lib/src/tizen_webview_controller.dart @@ -45,22 +45,22 @@ class TizenWebViewController extends PlatformWebViewController { case 'onConsoleMessage': JavaScriptLogLevel level = JavaScriptLogLevel.log; switch (arguments['level']! as String) { - case 'error': - level = JavaScriptLogLevel.error; - break; - case 'warning': - level = JavaScriptLogLevel.warning; - break; - case 'debug': - level = JavaScriptLogLevel.debug; - break; - case 'info': - level = JavaScriptLogLevel.info; - break; - case 'log': - level = JavaScriptLogLevel.log; - break; - } + case 'error': + level = JavaScriptLogLevel.error; + break; + case 'warning': + level = JavaScriptLogLevel.warning; + break; + case 'debug': + level = JavaScriptLogLevel.debug; + break; + case 'info': + level = JavaScriptLogLevel.info; + break; + case 'log': + level = JavaScriptLogLevel.log; + break; + } if (_onConsoleLogCallback != null) { _onConsoleLogCallback!(JavaScriptConsoleMessage( diff --git a/packages/webview_flutter/tizen/src/ewk_internal_api_binding.cc b/packages/webview_flutter/tizen/src/ewk_internal_api_binding.cc index 9f7aff9d0..e09a5692d 100644 --- a/packages/webview_flutter/tizen/src/ewk_internal_api_binding.cc +++ b/packages/webview_flutter/tizen/src/ewk_internal_api_binding.cc @@ -59,8 +59,8 @@ bool EwkInternalApiBinding::Initialize() { return view.SetBackgroundColor && view.FeedTouchEvent && view.SendKeyEvent && view.OffscreenRenderingEnabledSet && view.ImeWindowSet && - view.KeyEventsEnabledSet && view.SupportVideoHoleSet && main.SetArguments && - settings.ImePanelEnabledSet && console_message.LevelGet && - console_message.TextGet && console_message.LineGet && - console_message.SourceGet; + view.KeyEventsEnabledSet && view.SupportVideoHoleSet && + main.SetArguments && settings.ImePanelEnabledSet && + console_message.LevelGet && console_message.TextGet && + console_message.LineGet && console_message.SourceGet; } diff --git a/packages/webview_flutter/tizen/src/webview.cc b/packages/webview_flutter/tizen/src/webview.cc index 27d36bd11..ad6b0edce 100644 --- a/packages/webview_flutter/tizen/src/webview.cc +++ b/packages/webview_flutter/tizen/src/webview.cc @@ -28,21 +28,20 @@ constexpr char kTizenNavigationDelegateChannelName[] = "plugins.flutter.io/tizen_webview_navigation_delegate_"; std::string ConvertLogLevelToString(Ewk_Console_Message_Level level) { - switch (level) - { - case EWK_CONSOLE_MESSAGE_LEVEL_NULL: - case EWK_CONSOLE_MESSAGE_LEVEL_LOG: - return "log"; - case EWK_CONSOLE_MESSAGE_LEVEL_WARNING: - return "warning"; - case EWK_CONSOLE_MESSAGE_LEVEL_ERROR: - return "error"; - case EWK_CONSOLE_MESSAGE_LEVEL_DEBUG: - return "debug"; - case EWK_CONSOLE_MESSAGE_LEVEL_INFO: - return "info"; - default: - return "log"; + switch (level) { + case EWK_CONSOLE_MESSAGE_LEVEL_NULL: + case EWK_CONSOLE_MESSAGE_LEVEL_LOG: + return "log"; + case EWK_CONSOLE_MESSAGE_LEVEL_WARNING: + return "warning"; + case EWK_CONSOLE_MESSAGE_LEVEL_ERROR: + return "error"; + case EWK_CONSOLE_MESSAGE_LEVEL_DEBUG: + return "debug"; + case EWK_CONSOLE_MESSAGE_LEVEL_INFO: + return "info"; + default: + return "log"; } } @@ -166,7 +165,8 @@ std::string WebView::GetWebViewChannelName() { } std::string WebView::GetWebViewControllerChannelName() { - return std::string(kTizenWebViewControllerChannelName) + std::to_string(GetViewId()); + return std::string(kTizenWebViewControllerChannelName) + + std::to_string(GetViewId()); } std::string WebView::GetNavigationDelegateChannelName() { @@ -323,7 +323,8 @@ void WebView::InitWebView() { webview_instance_, true); #ifdef TV_PROFILE - EwkInternalApiBinding::GetInstance().view.SupportVideoHoleSet(webview_instance_, window_, true, false); + EwkInternalApiBinding::GetInstance().view.SupportVideoHoleSet( + webview_instance_, window_, true, false); #endif evas_object_smart_callback_add(webview_instance_, "offscreen,frame,rendered", @@ -696,12 +697,10 @@ void WebView::OnConsoleMessage(void* data, Evas_Object* obj, void* event_info) { flutter::EncodableMap args = { {flutter::EncodableValue("level"), flutter::EncodableValue(ConvertLogLevelToString(log_level))}, - {flutter::EncodableValue("message"), - flutter::EncodableValue(text)}, + {flutter::EncodableValue("message"), flutter::EncodableValue(text)}, }; webview->webview_controller_channel_->InvokeMethod( - "onConsoleMessage", - std::make_unique(args)); + "onConsoleMessage", std::make_unique(args)); } } }