Skip to content

Commit 229202a

Browse files
committed
Remove TextInputChannel's dependency on FlutterTizenEngine (#162)
1 parent 7f2c70e commit 229202a

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

shell/platform/tizen/channels/text_input_channel.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ bool IsASCIIPrintableKey(char c) {
4949

5050
} // namespace
5151

52-
TextInputChannel::TextInputChannel(BinaryMessenger* messenger,
53-
FlutterTizenEngine* engine)
52+
TextInputChannel::TextInputChannel(
53+
BinaryMessenger* messenger,
54+
std::unique_ptr<TizenInputMethodContext> input_method_context)
5455
: channel_(std::make_unique<MethodChannel<rapidjson::Document>>(
5556
messenger,
5657
kChannelName,
5758
&JsonMethodCodec::GetInstance())),
58-
input_method_context_(std::make_unique<TizenInputMethodContext>(engine)) {
59+
input_method_context_(std::move(input_method_context)) {
5960
channel_->SetMethodCallHandler(
6061
[this](const MethodCall<rapidjson::Document>& call,
6162
std::unique_ptr<MethodResult<rapidjson::Document>> result) {

shell/platform/tizen/channels/text_input_channel.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
namespace flutter {
2323

24-
class FlutterTizenEngine;
25-
2624
enum class EditStatus { kNone, kPreeditStart, kPreeditEnd, kCommit };
2725

2826
struct TextEditingContext {
@@ -36,8 +34,9 @@ struct TextEditingContext {
3634

3735
class TextInputChannel {
3836
public:
39-
explicit TextInputChannel(BinaryMessenger* messenger,
40-
FlutterTizenEngine* engine);
37+
explicit TextInputChannel(
38+
BinaryMessenger* messenger,
39+
std::unique_ptr<TizenInputMethodContext> input_method_context);
4140
virtual ~TextInputChannel();
4241

4342
bool IsSoftwareKeyboardShowing() { return is_software_keyboard_showing_; }

shell/platform/tizen/flutter_tizen_engine.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "flutter/shell/platform/tizen/logger.h"
1313
#include "flutter/shell/platform/tizen/system_utils.h"
14+
#include "flutter/shell/platform/tizen/tizen_input_method_context.h"
1415

1516
namespace flutter {
1617

@@ -257,7 +258,8 @@ bool FlutterTizenEngine::RunEngine(const char* entrypoint) {
257258
navigation_channel = std::make_unique<NavigationChannel>(
258259
internal_plugin_registrar_->messenger());
259260
text_input_channel = std::make_unique<TextInputChannel>(
260-
internal_plugin_registrar_->messenger(), this);
261+
internal_plugin_registrar_->messenger(),
262+
std::make_unique<TizenInputMethodContext>(this));
261263
platform_view_channel = std::make_unique<PlatformViewChannel>(
262264
internal_plugin_registrar_->messenger());
263265
key_event_handler_ = std::make_unique<KeyEventHandler>(this);

0 commit comments

Comments
 (0)