Skip to content

Commit

Permalink
Apply format
Browse files Browse the repository at this point in the history
Signed-off-by: swan.seo <[email protected]>
  • Loading branch information
Swanseo0 committed Nov 17, 2023
1 parent 1306e42 commit 77b8403
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 0 additions & 1 deletion packages/webview_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ const String kLogExamplePage = '''
</html>
''';


class WebViewExample extends StatefulWidget {
const WebViewExample({super.key});

Expand Down
32 changes: 16 additions & 16 deletions packages/webview_flutter/lib/src/tizen_webview_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
41 changes: 20 additions & 21 deletions packages/webview_flutter/tizen/src/webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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<flutter::EncodableValue>(args));
"onConsoleMessage", std::make_unique<flutter::EncodableValue>(args));
}
}
}
Expand Down

0 comments on commit 77b8403

Please sign in to comment.