Skip to content
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
1 change: 1 addition & 0 deletions shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ _flutter_tizen_source = [
"flutter_tizen_texture_registrar.cc",
"key_event_handler.cc",
"tizen_event_loop.cc",
"tizen_input_method_context.cc",
"tizen_renderer.cc",
"touch_event_handler.cc",
]
Expand Down
31 changes: 2 additions & 29 deletions shell/platform/tizen/channels/platform_view_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_message_codec.h"
#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h"
#include "flutter/shell/platform/common/json_method_codec.h"
#include "flutter/shell/platform/tizen/channels/text_input_channel.h"
#include "flutter/shell/platform/tizen/flutter_tizen_engine.h"
#include "flutter/shell/platform/tizen/public/flutter_platform_view.h"
#include "flutter/shell/platform/tizen/tizen_log.h"
Expand All @@ -33,10 +32,8 @@ bool GetValueFromEncodableMap(const EncodableValue& arguments,
return false;
}

PlatformViewChannel::PlatformViewChannel(BinaryMessenger* messenger,
FlutterTizenEngine* engine)
: engine_(engine),
channel_(std::make_unique<MethodChannel<EncodableValue>>(
PlatformViewChannel::PlatformViewChannel(BinaryMessenger* messenger)
: channel_(std::make_unique<MethodChannel<EncodableValue>>(
messenger,
kChannelName,
&StandardMethodCodec::GetInstance())) {
Expand Down Expand Up @@ -95,23 +92,6 @@ void PlatformViewChannel::SendKeyEvent(Ecore_Event_Key* key, bool is_down) {
}
}

void PlatformViewChannel::DispatchCompositionUpdateEvent(
const std::string& key) {
auto instances = ViewInstances();
auto it = instances.find(CurrentFocusedViewId());
if (it != instances.end()) {
it->second->DispatchCompositionUpdateEvent(key.c_str(), key.size());
}
}

void PlatformViewChannel::DispatchCompositionEndEvent(const std::string& key) {
auto instances = ViewInstances();
auto it = instances.find(CurrentFocusedViewId());
if (it != instances.end()) {
it->second->DispatchCompositionEndEvent(key.c_str(), key.size());
}
}

int PlatformViewChannel::CurrentFocusedViewId() {
for (auto it = view_instances_.begin(); it != view_instances_.end(); it++) {
if (it->second->IsFocused()) {
Expand Down Expand Up @@ -162,12 +142,6 @@ void PlatformViewChannel::HandleMethodCall(
if (view_instance) {
view_instances_.insert(
std::pair<int, PlatformView*>(view_id, view_instance));

if (engine_ && engine_->text_input_channel) {
Ecore_IMF_Context* context =
engine_->text_input_channel->GetImfContext();
view_instance->SetSoftwareKeyboardContext(context);
}
result->Success(EncodableValue(view_instance->GetTextureId()));
} else {
result->Error("Can't create a webview instance!!");
Expand Down Expand Up @@ -264,5 +238,4 @@ void PlatformViewChannel::HandleMethodCall(
}
}
}

} // namespace flutter
9 changes: 1 addition & 8 deletions shell/platform/tizen/channels/platform_view_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ class PlatformViewFactory;

namespace flutter {

class FlutterTizenEngine;

class PlatformViewChannel {
public:
explicit PlatformViewChannel(BinaryMessenger* messenger,
FlutterTizenEngine* engine);
explicit PlatformViewChannel(BinaryMessenger* messenger);
virtual ~PlatformViewChannel();

void Dispose();
Expand All @@ -41,14 +38,10 @@ class PlatformViewChannel {
void SendKeyEvent(Ecore_Event_Key* key, bool is_down);
int CurrentFocusedViewId();

void DispatchCompositionUpdateEvent(const std::string& key);
void DispatchCompositionEndEvent(const std::string& key);

private:
void HandleMethodCall(const MethodCall<EncodableValue>& call,
std::unique_ptr<MethodResult<EncodableValue>> result);

FlutterTizenEngine* engine_;
std::unique_ptr<MethodChannel<EncodableValue>> channel_;
std::map<std::string, std::unique_ptr<PlatformViewFactory>> view_factories_;
std::map<int, PlatformView*> view_instances_;
Expand Down
Loading