[WRTjs][VD]Dim minimized button for non-multitasking app 44/294044/2
authorzhaosy <shiyusy.zhao@samsung.com>
Mon, 12 Jun 2023 04:39:20 +0000 (12:39 +0800)
committerzhaosy <shiyusy.zhao@samsung.com>
Mon, 12 Jun 2023 05:03:10 +0000 (13:03 +0800)
For non-multitasking app, minimized button should be dimmed

Change-Id: I8832baa75cd84c490e429d0d4119fd5faba76988
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
wrt/src/browser/api/tv/wrt_api_tv_extension.cc
wrt/src/browser/tv/decorator_window.cc [changed mode: 0755->0644]
wrt/src/browser/tv/native_web_runtime_delegate_tv.cc
wrt/src/browser/tv/native_web_runtime_delegate_tv.h

index 4cfae6f567e1b53f8b81a6fe5e3b5f407f266df2..dc4637b5b934b9fa8c85d5da4dad608e39383bcf 100644 (file)
@@ -57,8 +57,6 @@ base::FilePath GetTmgPath(const std::string& pkg_path) {
 const char* kLoadDefaultURI =
   "http://samsung.com/tv/metadata/force.loadDefaultURI";
 const char* kVconfCurrentAppId = "memory/appfw/current_fullscreen_appid";
-const char* kMultitaskingSupport =
-    "http://samsung.com/tv/metadata/multitasking.support";
 const char* kVconfNotifyInstallKey = "memory/was/request_install";
 const char* kDefaultSsoError =
     "{\"error\":\"unknown\", \"error_code\":-1}";
@@ -201,27 +199,7 @@ std::string TVExtension::GetCameraInfo() const {
 }
 
 bool TVExtension::GetMultitaskingSupport() const {
-  auto& app_data = ApplicationData::GetInstance();
-
-  bool multitasking_support = true;
-  bool systemSupport = HasSystemMultitaskingSupport();
-  LOG(INFO) << "system multitasking support = " << systemSupport;
-  auto multitasking_value = app_data.GetMetadata(kMultitaskingSupport);
-
-  if (systemSupport) {
-    if (multitasking_value == "false") {
-      multitasking_support = false;
-      LOG(INFO) << "multitasking.support : false";
-    }
-  } else {
-    if (multitasking_value == "force") {
-      LOG(INFO) << "multitasking.support : force";
-    } else {
-      LOG(ERROR) << "this system doesn't support multitasking mode";
-      multitasking_support = false;
-    }
-  }
-  return multitasking_support;
+  return NativeWebRuntimeDelegateTV::GetInstance().IsMultitaskingSupport();
 }
 
 std::string TVExtension::GetProxy() const {
old mode 100755 (executable)
new mode 100644 (file)
index 052b6a4..55ff0ff
@@ -23,6 +23,7 @@
 #include "base/path_service.h"
 #include "tizen_src/chromium_impl/content/common/paths_efl.h"
 #include "wrt/src/browser/native_web_runtime.h"
+#include "wrt/src/browser/tv/native_web_runtime_delegate_tv.h"
 #include "wrt/src/common/application_data.h"
 
 namespace wrt {
@@ -113,7 +114,10 @@ void DecoratorWindow::SetDecoratorWindow(Evas_Object* top_window) {
   AddFunctionButton(box, "border-pbpL-dimmed", true, nullptr);
   AddFunctionButton(box, "border-pbpR-dimmed", true, nullptr);
 
-  AddFunctionButton(box, "border-min", false, OnMinimizeClickedCB);
+  if (NativeWebRuntimeDelegateTV::GetInstance().IsMultitaskingSupport())
+    AddFunctionButton(box, "border-min", false, OnMinimizeClickedCB);
+  else
+    AddFunctionButton(box, "border-min-dimmed", false, OnMinimizeClickedCB);
 
   auto& app_data = ApplicationData::GetInstance();
   if (app_data.GetMetadata(kDecoratorResizeSupport) == "true") {
index 93a5190cb18091575e8cc10fffa4e392affc721a..0b56baa8f36eaa4b71eb2132a91a8ffee00a2285 100644 (file)
@@ -100,6 +100,8 @@ const char* kWrtLoaderCount = "rtc/memory/WebApp/wrtloadercount";
 const char* kWrtMessagePort = "wrt.message.port";
 const char* kCameraHardwareEncoderSupportEnabled =
     "http://samsung.com/tv/metadata/camera.hardware.encoder.support";
+const char* kMultitaskingSupport =
+    "http://samsung.com/tv/metadata/multitasking.support";
 
 #if defined(TIZEN_VIDEO_HOLE)
 const char* kVideoHoleSupport =
@@ -726,4 +728,28 @@ void NativeWebRuntimeDelegateTV::PreloadFMS() {
   LOG(INFO) << "PreloadFMS end";
 }
 
+bool NativeWebRuntimeDelegateTV::IsMultitaskingSupport() {
+  auto& app_data = ApplicationData::GetInstance();
+
+  bool multitasking_support = true;
+  bool systemSupport = HasSystemMultitaskingSupport();
+  LOG(INFO) << "system multitasking support = " << systemSupport;
+  auto multitasking_value = app_data.GetMetadata(kMultitaskingSupport);
+
+  if (systemSupport) {
+    if (multitasking_value == "false") {
+      multitasking_support = false;
+      LOG(INFO) << "multitasking.support : false";
+    }
+  } else {
+    if (multitasking_value == "force") {
+      LOG(INFO) << "multitasking.support : force";
+    } else {
+      LOG(ERROR) << "this system doesn't support multitasking mode";
+      multitasking_support = false;
+    }
+  }
+  return multitasking_support;
+}
+
 }  // namespace wrt
index 2eb45f649cf6e23229534d8382e14007c911e29f..84812ab62aecb6f61358650a39c04e459fd928e6 100644 (file)
@@ -23,6 +23,7 @@ class NativeWebRuntimeDelegateTV : public WRTProfileDelegate {
   bool IsAllowMixedContentMetaTagSet(bool& allow_mixed_content);
   bool IsCameraHardwareEncoderSupportEnabled();
   bool IsInitialized() { return initialized_; }
+  bool IsMultitaskingSupport();
   bool IsSpatialNavigationMetaTagSet();
   bool IsViewportMetaTagSet();
 #if defined(TIZEN_VIDEO_HOLE)