[M120 Migration][WRTjs][VD] Fix camera permission denied issue 27/305527/6
authorzhaosy <shiyusy.zhao@samsung.com>
Sun, 4 Feb 2024 03:21:25 +0000 (11:21 +0800)
committerBot Blink <blinkbot@samsung.com>
Wed, 7 Feb 2024 13:42:09 +0000 (13:42 +0000)
In PermissionControllerDelegate::GetPermissionResultForCurrentDocument,
PermissionStatus::DENIED is return as default, so can't use camera for webapp.

Override GetPermissionResultForCurrentDocument in WRT, return PermissionStatus::GRANTED.

Reference:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/292389/

Change-Id: Ib98e5ec9f73c66493a4df6f8bc1ffa3cfe4a7d7e
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
electron/shell/browser/electron_browser_context.cc

index 2eda1c3..a35cbe7 100644 (file)
 #include "components/spellcheck/common/spellcheck_common.h"
 #endif
 
+#if defined(ENABLE_WRT_JS)
+#include "wrt/src/browser/wrt_permission_manager.h"
+#endif
+
 using content::BrowserThread;
 
 namespace electron {
@@ -409,8 +413,13 @@ ElectronBrowserContext::GetPlatformNotificationService() {
 
 content::PermissionControllerDelegate*
 ElectronBrowserContext::GetPermissionControllerDelegate() {
-  if (!permission_manager_.get())
+  if (!permission_manager_.get()) {
+#if defined(ENABLE_WRT_JS)
+    permission_manager_ = std::make_unique<wrt::WRTPermissionManager>();
+#else
     permission_manager_ = std::make_unique<ElectronPermissionManager>();
+#endif
+  }
   return permission_manager_.get();
 }