evas_object_event_callback_del(native_view_, EVAS_CALLBACK_RESIZE,
EWebView::NativeViewResize);
-#if defined(USE_WAYLAND) && !BUILDFLAG(IS_TIZEN_TV)
- ClipboardHelperEfl::GetInstance()->MaybeInvalidateActiveWebview(this);
+#if defined(USE_WAYLAND)
+ if (GetSettings()->getClipboardEnabled())
+ ClipboardHelperEfl::GetInstance()->MaybeInvalidateActiveWebview(this);
#endif
std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*>::iterator
void EWebView::OnFocusIn() {
SmartCallback<EWebViewCallbacks::FocusIn>().call();
-#if defined(USE_WAYLAND) && !BUILDFLAG(IS_TIZEN_TV)
+#if defined(USE_WAYLAND)
if (!rwhva() || !rwhva()->offscreen_helper())
return;
- ClipboardHelperEfl::GetInstance()->OnWebviewFocusIn(
- this, rwhva()->offscreen_helper()->content_image_elm_host(),
- rwhva()->offscreen_helper()->IsFocusedNodeContentEditable(),
- base::BindRepeating(&EWebView::ExecuteEditCommand,
- base::Unretained(this)));
+ if (GetSettings()->getClipboardEnabled()) {
+ ClipboardHelperEfl::GetInstance()->OnWebviewFocusIn(
+ this, rwhva()->offscreen_helper()->content_image_elm_host(),
+ rwhva()->offscreen_helper()->IsFocusedNodeContentEditable(),
+ base::BindRepeating(&EWebView::ExecuteEditCommand,
+ base::Unretained(this)));
+ }
#endif
}
void EWebView::OnFocusOut() {
SmartCallback<EWebViewCallbacks::FocusOut>().call();
-#if defined(USE_WAYLAND) && !BUILDFLAG(IS_TIZEN_TV)
- ClipboardHelperEfl::GetInstance()->MaybeInvalidateActiveWebview(this);
+#if defined(USE_WAYLAND)
+ if (GetSettings()->getClipboardEnabled())
+ ClipboardHelperEfl::GetInstance()->MaybeInvalidateActiveWebview(this);
#endif
}
#include "ewk_settings_private.h"
#include "net/http/http_stream_factory.h"
+#include "tizen/system_info.h"
Ewk_Settings::Ewk_Settings(Evas_Object* evas_object,
const WebPreferences& preferences)
content::EdgeEffect::EnableGlobally(enable);
#endif
}
+
+bool Ewk_Settings::getClipboardEnabled() const {
+ if (IsTvProfile())
+ return m_clipboardEnabled;
+ else
+ return true;
+}
bool getURLBarHideEnabled() const { return m_URLBarHide; }
void setTouchFocusEnabled(bool enable) { m_touchFocusEnabled = enable; }
bool touchFocusEnabled() const { return m_touchFocusEnabled; }
+ void setClipboardEnabled(bool enable) { m_clipboardEnabled = enable; }
+ bool getClipboardEnabled() const;
private:
WebPreferences m_preferences;
bool m_allowRestrictedURL = true;
bool m_URLBarHide = false;
bool m_touchFocusEnabled = true;
+ bool m_clipboardEnabled = false;
};
#endif // ewk_settings_private_h
void ewk_settings_clipboard_enabled_set(Ewk_Settings* settings, Eina_Bool enabled)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ EINA_SAFETY_ON_NULL_RETURN(settings);
+ settings->setClipboardEnabled(!!enabled);
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV");
+#endif
}
Eina_Bool ewk_settings_clipboard_enabled_get(const Ewk_Settings* settings)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ EINA_SAFETY_ON_NULL_RETURN_VAL(settings, EINA_FALSE);
+ return settings->getClipboardEnabled();
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV");
return EINA_FALSE;
+#endif
}
Eina_Bool ewk_settings_javascript_can_access_clipboard_set(Ewk_Settings* settings, Eina_Bool enable)