1414#include " flutter/shell/platform/tizen/channels/tizen_shell.h"
1515#endif
1616#include " flutter/shell/platform/tizen/logger.h"
17+ #include " flutter/shell/platform/tizen/tizen_view.h"
18+ #include " flutter/shell/platform/tizen/tizen_window.h"
1719
1820namespace flutter {
1921
@@ -62,12 +64,12 @@ std::string text_clipboard = "";
6264} // namespace
6365
6466PlatformChannel::PlatformChannel (BinaryMessenger* messenger,
65- TizenWindow* window )
67+ TizenViewBase* view )
6668 : channel_(std::make_unique<MethodChannel<rapidjson::Document>>(
6769 messenger,
6870 kChannelName ,
6971 &JsonMethodCodec::GetInstance ())),
70- window_(window ) {
72+ view_(view ) {
7173 channel_->SetMethodCallHandler (
7274 [this ](const MethodCall<rapidjson::Document>& call,
7375 std::unique_ptr<MethodResult<rapidjson::Document>> result) {
@@ -156,8 +158,10 @@ void PlatformChannel::HandleMethodCall(
156158}
157159
158160void PlatformChannel::SystemNavigatorPop () {
159- if (window_ ) {
161+ if (view_-> GetType () == TizenViewType:: kWindow ) {
160162 ui_app_exit ();
163+ } else {
164+ reinterpret_cast <TizenView*>(view_)->Unfocus ();
161165 }
162166}
163167
@@ -174,13 +178,13 @@ void PlatformChannel::HapticFeedbackVibrate(const std::string& feedback_type) {
174178}
175179
176180void PlatformChannel::RestoreSystemUiOverlays () {
177- if (!window_ ) {
181+ if (view_-> GetType () != TizenViewType:: kWindow ) {
178182 return ;
179183 }
180184
181185#ifdef COMMON_PROFILE
182186 auto & shell = TizenShell::GetInstance ();
183- shell.InitializeSoftkey (window_ ->GetWindowId ());
187+ shell.InitializeSoftkey (view_ ->GetWindowId ());
184188
185189 if (shell.IsSoftkeyShown ()) {
186190 shell.ShowSoftkey ();
@@ -192,13 +196,13 @@ void PlatformChannel::RestoreSystemUiOverlays() {
192196
193197void PlatformChannel::SetEnabledSystemUiOverlays (
194198 const std::vector<std::string>& overlays) {
195- if (!window_ ) {
199+ if (view_-> GetType () != TizenViewType:: kWindow ) {
196200 return ;
197201 }
198202
199203#ifdef COMMON_PROFILE
200204 auto & shell = TizenShell::GetInstance ();
201- shell.InitializeSoftkey (window_ ->GetWindowId ());
205+ shell.InitializeSoftkey (view_ ->GetWindowId ());
202206
203207 if (std::find (overlays.begin (), overlays.end (), kSystemUiOverlayBottom ) !=
204208 overlays.end ()) {
@@ -211,7 +215,7 @@ void PlatformChannel::SetEnabledSystemUiOverlays(
211215
212216void PlatformChannel::SetPreferredOrientations (
213217 const std::vector<std::string>& orientations) {
214- if (!window_ ) {
218+ if (view_-> GetType () != TizenViewType:: kWindow ) {
215219 return ;
216220 }
217221
@@ -230,7 +234,7 @@ void PlatformChannel::SetPreferredOrientations(
230234 // default.
231235 rotations = {0 , 90 , 180 , 270 };
232236 }
233- window_ ->SetPreferredOrientations (rotations);
237+ reinterpret_cast <TizenWindow*>(view_) ->SetPreferredOrientations (rotations);
234238}
235239
236240} // namespace flutter
0 commit comments