From 1dfdf333f6e6dafdf05e5368bc57a519bf244598 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Mon, 9 Jan 2023 09:39:46 +0530 Subject: [PATCH] [M108 Migration] Add public EWK APIs for multimedia and refactor TizenExtensibleAPI Define public APIs - Public API request for BackgroundMusic - Public API reuqest for BlockMultimediaOnCall - Public API request for EnableManualVideoRotation - Public API reuqest for SoundMode This patch also refactors TIzenExtensibleAPI. Reference: https://review.tizen.org/gerrit/273210/ Change-Id: I0b92aeb1900d69be7773e20b409f15fd481447d6 Signed-off-by: ayush.k123 --- tizen_src/ewk/efl_integration/BUILD.gn | 6 +- .../browser/tizen_extensible_host.cc | 103 +++++++++++++++++++++ .../browser/tizen_extensible_host.h | 46 +++++++++ .../efl_integration/common/render_messages_ewk.h | 7 ++ .../ewk/efl_integration/common/tizen_extensible.cc | 43 --------- .../ewk/efl_integration/common/tizen_extensible.h | 26 ------ tizen_src/ewk/efl_integration/eweb_context.cc | 7 +- tizen_src/ewk/efl_integration/eweb_context.h | 3 - .../ewk/efl_integration/public/ewk_context.cc | 42 +++++---- .../renderer/render_thread_observer_efl.cc | 13 +++ .../renderer/render_thread_observer_efl.h | 5 +- .../efl_integration/renderer/tizen_extensible.cc | 59 ++++++++++++ .../efl_integration/renderer/tizen_extensible.h | 36 +++++++ 13 files changed, 300 insertions(+), 96 deletions(-) create mode 100644 tizen_src/ewk/efl_integration/browser/tizen_extensible_host.cc create mode 100644 tizen_src/ewk/efl_integration/browser/tizen_extensible_host.h delete mode 100644 tizen_src/ewk/efl_integration/common/tizen_extensible.cc delete mode 100644 tizen_src/ewk/efl_integration/common/tizen_extensible.h create mode 100644 tizen_src/ewk/efl_integration/renderer/tizen_extensible.cc create mode 100644 tizen_src/ewk/efl_integration/renderer/tizen_extensible.h diff --git a/tizen_src/ewk/efl_integration/BUILD.gn b/tizen_src/ewk/efl_integration/BUILD.gn index ffbec1e..1a195b6 100644 --- a/tizen_src/ewk/efl_integration/BUILD.gn +++ b/tizen_src/ewk/efl_integration/BUILD.gn @@ -217,6 +217,8 @@ shared_library("chromium-ewk") { "browser/sound_effect_tizen.cc", "browser/ssl_host_state_delegate_efl.cc", "browser/ssl_host_state_delegate_efl.h", + "browser/tizen_extensible_host.cc", + "browser/tizen_extensible_host.h", "browser/web_view_browser_message_filter.cc", "browser/web_view_browser_message_filter.h", "browser_context_efl.cc", @@ -338,8 +340,6 @@ shared_library("chromium-ewk") { "common/print_pages_params.cc", "common/print_pages_params.h", "common/render_messages_ewk.h", - "common/tizen_extensible.cc", - "common/tizen_extensible.h", "common/version_info.cc", "common/version_info.h", "common/version_info_efl.h", @@ -537,6 +537,8 @@ shared_library("chromium-ewk") { "renderer/render_frame_observer_efl.h", "renderer/render_thread_observer_efl.cc", "renderer/render_thread_observer_efl.h", + "renderer/tizen_extensible.cc", + "renderer/tizen_extensible.h", "wrt/dynamicplugin.cc", "wrt/dynamicplugin.h", "wrt/v8widget.cc", diff --git a/tizen_src/ewk/efl_integration/browser/tizen_extensible_host.cc b/tizen_src/ewk/efl_integration/browser/tizen_extensible_host.cc new file mode 100644 index 0000000..fc6173e --- /dev/null +++ b/tizen_src/ewk/efl_integration/browser/tizen_extensible_host.cc @@ -0,0 +1,103 @@ +// Copyright 2016 Samsung Electronics. All rights reseoved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "browser/tizen_extensible_host.h" + +#include "common/render_messages_ewk.h" +#include "content/public/browser/notification_service.h" +#include "content/public/browser/notification_source.h" +#include "content/public/browser/notification_types.h" +#include "content/public/browser/render_process_host.h" + +// static +TizenExtensibleHost* TizenExtensibleHost::GetInstance() { + return base::Singleton::get(); +} + +TizenExtensibleHost::TizenExtensibleHost() + : extensible_api_table_{ + {"background,music", true}, + {"background,vibration", false}, + {"block,multimedia,on,call", false}, + {"csp", false}, + {"encrypted,database", false}, + {"fullscreen", false}, + {"mediastream,record", false}, + {"media,volume,control", false}, + {"prerendering,for,rotation", false}, + {"rotate,camera,view", true}, + {"rotation,lock", false}, + {"sound,mode", false}, + {"support,fullscreen", true}, + {"visibility,suspend", false}, + {"xwindow,for,fullscreen,video", false}, + {"support,multimedia", true}, + } {} + +TizenExtensibleHost::~TizenExtensibleHost() {} + +void TizenExtensibleHost::Initialize() { + if (registrar_.IsEmpty()) { + registrar_.Add( + this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, + content::NotificationService::AllBrowserContextsAndSources()); + registrar_.Add( + this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, + content::NotificationService::AllBrowserContextsAndSources()); + } +} + +void TizenExtensibleHost::Observe(int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { + content::RenderProcessHost* process = + content::Source(source).ptr(); + DCHECK(process); + + int renderer_id = process->GetID(); + switch (type) { + case content::NOTIFICATION_RENDERER_PROCESS_CREATED: { + renderers_.insert(renderer_id); + UpdateTizenExtensible(renderer_id); + break; + } + case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: { + renderers_.erase(renderer_id); + break; + } + default: + NOTREACHED(); + break; + } +} + +void TizenExtensibleHost::UpdateTizenExtensible(int render_process_id) { + DCHECK(render_process_id); + DCHECK(renderers_.find(render_process_id) != renderers_.end()); + content::RenderProcessHost* host = + content::RenderProcessHost::FromID(render_process_id); + if (host) + host->Send(new EwkProcessMsg_UpdateTizenExtensible(extensible_api_table_)); +} + +bool TizenExtensibleHost::SetExtensibleAPI(const std::string& api_name, + bool enable) { + auto it = extensible_api_table_.find(api_name); + if (it == extensible_api_table_.end()) + return false; + it->second = enable; + + for_each(renderers_.begin(), renderers_.end(), [api_name, enable](int e) { + content::RenderProcessHost* host = content::RenderProcessHost::FromID(e); + if (host) + host->Send(new EwkProcessMsg_SetExtensibleAPI(api_name, enable)); + }); + + return true; +} + +bool TizenExtensibleHost::GetExtensibleAPI(const std::string& api_name) { + auto it = extensible_api_table_.find(api_name); + return ((it == extensible_api_table_.end()) ? false : it->second); +} diff --git a/tizen_src/ewk/efl_integration/browser/tizen_extensible_host.h b/tizen_src/ewk/efl_integration/browser/tizen_extensible_host.h new file mode 100644 index 0000000..b4e8387 --- /dev/null +++ b/tizen_src/ewk/efl_integration/browser/tizen_extensible_host.h @@ -0,0 +1,46 @@ +// Copyright 2016 Samsung Electronics. All rights reseoved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EWK_EFL_INTEGRATION_BROWSER_TIZEN_EXTENSIBLE_HOST_H +#define EWK_EFL_INTEGRATION_BROWSER_TIZEN_EXTENSIBLE_HOST_H + +#include +#include +#include + +#include "base/compiler_specific.h" +#include "base/memory/singleton.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" +#include "public/ewk_context.h" + +class TizenExtensibleHost : public content::NotificationObserver { + public: + static TizenExtensibleHost* GetInstance(); + void Initialize(); + + // content::NotificationObserver implementation: + void Observe(int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) override; + void UpdateTizenExtensible(int render_process_id); + + // Tizen Extensible API + bool SetExtensibleAPI(const std::string& api_name, bool enable); + bool GetExtensibleAPI(const std::string& api_name); + + private: + TizenExtensibleHost(); + ~TizenExtensibleHost() override; + + TizenExtensibleHost(const TizenExtensibleHost&) = delete; + TizenExtensibleHost& operator=(const TizenExtensibleHost&) = delete; + + content::NotificationRegistrar registrar_; + std::set renderers_; + std::map extensible_api_table_; + friend struct base::DefaultSingletonTraits; +}; + +#endif // EWK_EFL_INTEGRATION_BROWSER_TIZEN_EXTENSIBLE_HOST_H diff --git a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h index 2e73e7e..273fd8a 100644 --- a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h +++ b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h @@ -24,6 +24,7 @@ #include "ipc_message_start_ewk.h" typedef std::map StringMap; +typedef std::map ExtensibleApiMap; #define IPC_MESSAGE_START EwkMsgStart @@ -288,4 +289,10 @@ IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK, bool /* prevState */, bool /* nextState */) +IPC_MESSAGE_CONTROL1(EwkProcessMsg_UpdateTizenExtensible, + ExtensibleApiMap /* Extensible APIs */) +IPC_MESSAGE_CONTROL2(EwkProcessMsg_SetExtensibleAPI, + std::string /* api name */, + bool /* enable */) + IPC_MESSAGE_ROUTED0(EwkHostMsg_DidNotAllowScript) diff --git a/tizen_src/ewk/efl_integration/common/tizen_extensible.cc b/tizen_src/ewk/efl_integration/common/tizen_extensible.cc deleted file mode 100644 index 9efec1f..0000000 --- a/tizen_src/ewk/efl_integration/common/tizen_extensible.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2015 Samsung Electronics. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "tizen_extensible.h" - - -TizenExtensible::TizenExtensible() : - extensible_API_table_ { - { "background,music", true }, - { "csp", false }, - { "encrypted,database", false }, - { "fullscreen", false }, - { "fullscreen,forbid,auto,exit", false }, - { "mediastream,record", false }, - { "media,volume,control", false }, - { "prerendering,for,rotation", false }, - { "rotate,camera,view", true }, - { "rotation,lock", false }, - { "sound,mode", false }, - { "support,fullscreen", true }, - { "visibility,suspend", false }, - { "xwindow,for,fullscreen,video", false }, - { "support,multimedia", true }, - } { - -} - -bool TizenExtensible::SetAPI(const std::string& api_name, const bool enable) { - auto it = extensible_API_table_.find(api_name); - if (it == extensible_API_table_.end()) - return false; - it->second = enable; - return true; -} - -bool TizenExtensible::GetAPI(const std::string& api_name) const { - auto it = extensible_API_table_.find(api_name); - if (it == extensible_API_table_.end()) - return false; - return it->second; -} - diff --git a/tizen_src/ewk/efl_integration/common/tizen_extensible.h b/tizen_src/ewk/efl_integration/common/tizen_extensible.h deleted file mode 100644 index 91cf208..0000000 --- a/tizen_src/ewk/efl_integration/common/tizen_extensible.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 Samsung Electronics. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - -#ifndef TIZEN_EXTENSIBLE_h -#define TIZEN_EXTENSIBLE_h - -#include -#include - -class TizenExtensible { - public: - static TizenExtensible* create() { - return new TizenExtensible(); - } - - bool SetAPI(const std::string& api_name, const bool enable); - bool GetAPI(const std::string& api_name) const; - - private: - TizenExtensible(); - std::unordered_map extensible_API_table_; -}; - -#endif // TIZEN_EXTENSIBLE_h diff --git a/tizen_src/ewk/efl_integration/eweb_context.cc b/tizen_src/ewk/efl_integration/eweb_context.cc index 4b77984..10786a8 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.cc +++ b/tizen_src/ewk/efl_integration/eweb_context.cc @@ -14,6 +14,7 @@ #include "base/synchronization/waitable_event.h" #include "base/task/thread_pool.h" #include "browser/favicon/favicon_database.h" +#include "browser/tizen_extensible_host.h" #include "browser/webdata/web_data_service_factory.h" #include "components/autofill/content/browser/content_autofill_driver.h" #include "content/public/browser/browser_context.h" @@ -337,7 +338,7 @@ EWebContext::EWebContext(bool incognito, const std::string& injectedBundlePath) ewk_favicon_database_.reset(new EwkFaviconDatabase(this)); notification_cb_.reset( new EWebContextNotificationCallback(nullptr, nullptr, nullptr, nullptr)); - tizen_extensible_.reset(TizenExtensible::create()); + TizenExtensibleHost::GetInstance()->Initialize(); #if BUILDFLAG(IS_TIZEN) if (should_preload_injected_bundle) { @@ -807,9 +808,9 @@ bool EWebContext::NotificationCancelCallback(uint64_t notification_id) { } bool EWebContext::SetExtensibleAPI(const std::string& api_name, bool enable) { - return tizen_extensible_->SetAPI(api_name, enable); + return TizenExtensibleHost::GetInstance()->SetExtensibleAPI(api_name, enable); } bool EWebContext::GetExtensibleAPI(const std::string& api_name) { - return tizen_extensible_->GetAPI(api_name); + return TizenExtensibleHost::GetInstance()->GetExtensibleAPI(api_name); } diff --git a/tizen_src/ewk/efl_integration/eweb_context.h b/tizen_src/ewk/efl_integration/eweb_context.h index 73742b9..f600b6b 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.h +++ b/tizen_src/ewk/efl_integration/eweb_context.h @@ -7,7 +7,6 @@ #include "base/files/file_path.h" #include "browser/web_cache_efl/web_cache_manager_efl.h" -#include "common/tizen_extensible.h" #include "private/ewk_cookie_manager_private.h" #include "public/ewk_context.h" #include "public/ewk_context_product.h" @@ -16,7 +15,6 @@ class CookieManager; class Ewk_Wrt_Message_Data; -class TizenExtensible; class EwkFaviconDatabase; namespace content { @@ -184,7 +182,6 @@ class EWebContext { std::unique_ptr web_cache_manager_; std::unique_ptr browser_context_; std::unique_ptr ewk_cookie_manager_; - std::unique_ptr tizen_extensible_; std::unique_ptr ewk_favicon_database_; std::string proxy_uri_; std::string proxy_username_; diff --git a/tizen_src/ewk/efl_integration/public/ewk_context.cc b/tizen_src/ewk/efl_integration/public/ewk_context.cc index 57bd33d..c7c1e79 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_context.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_context.cc @@ -533,14 +533,14 @@ Eina_Bool ewk_context_tizen_extensible_api_string_get(Ewk_Context* context, con Eina_Bool ewk_context_tizen_extensible_api_set(Ewk_Context * /*context*/, Ewk_Extensible_API /*extensibleAPI*/, Eina_Bool /*enable*/) { - //This API will not be implemented with chromium engine based Ewk View + // This API was deprecated. NOTIMPLEMENTED(); return EINA_FALSE; } Eina_Bool ewk_context_tizen_extensible_api_get(Ewk_Context * /*context*/, Ewk_Extensible_API /*extensibleAPI*/) { - //This API will not be implemented with chromium engine based Ewk View + // This API was deprecated. NOTIMPLEMENTED(); return EINA_FALSE; } @@ -864,50 +864,56 @@ void ewk_context_intercept_request_cancel_callback_set(Ewk_Context* ewk_context, Eina_Bool ewk_context_background_music_get(Ewk_Context* context) { - LOG_EWK_API_MOCKUP(); - return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + return ewk_context_tizen_extensible_api_string_get(context, + "background,music"); } Eina_Bool ewk_context_background_music_set(Ewk_Context* context, Eina_Bool enable) { - LOG_EWK_API_MOCKUP(); - return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + return ewk_context_tizen_extensible_api_string_set( + context, "background,music", enable); } Eina_Bool ewk_context_block_multimedia_on_call_get(Ewk_Context* context) { - LOG_EWK_API_MOCKUP(); - return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + return ewk_context_tizen_extensible_api_string_get( + context, "block,multimedia,on,call"); } Eina_Bool ewk_context_block_multimedia_on_call_set(Ewk_Context* context, Eina_Bool enable) { - LOG_EWK_API_MOCKUP(); - return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + return ewk_context_tizen_extensible_api_string_set( + context, "block,multimedia,on,call", enable); } Eina_Bool ewk_context_rotation_lock_get(Ewk_Context* context) { - LOG_EWK_API_MOCKUP(); - return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + return ewk_context_tizen_extensible_api_string_get(context, "rotation,lock"); } Eina_Bool ewk_context_rotation_lock_set(Ewk_Context* context, Eina_Bool enable) { - LOG_EWK_API_MOCKUP(); - return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + return ewk_context_tizen_extensible_api_string_set(context, "rotation,lock", + enable); } Eina_Bool ewk_context_sound_overlap_get(Ewk_Context* context) { - LOG_EWK_API_MOCKUP(); - return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + return ewk_context_tizen_extensible_api_string_get(context, "sound,mode"); } Eina_Bool ewk_context_sound_overlap_set(Ewk_Context* context, Eina_Bool enable) { - LOG_EWK_API_MOCKUP(); - return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + return ewk_context_tizen_extensible_api_string_set(context, "sound,mode", + enable); } Eina_Bool ewk_context_app_control_set(const Ewk_Context* context, void* app_control) diff --git a/tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.cc b/tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.cc index aef91b4..5b789ea 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.cc @@ -10,6 +10,7 @@ #include "common/render_messages_ewk.h" #include "content/public/renderer/render_thread.h" #include "renderer/content_renderer_client_efl.h" +#include "renderer/tizen_extensible.h" #include "third_party/blink/public/platform/web_cache.h" #include "third_party/sqlite/sqlite3.h" #include "v8/include/v8.h" @@ -41,6 +42,9 @@ bool RenderThreadObserverEfl::OnControlMessageReceived(const IPC::Message& messa IPC_BEGIN_MESSAGE_MAP(RenderThreadObserverEfl, message) IPC_MESSAGE_HANDLER(EflViewMsg_ClearCache, OnClearCache) IPC_MESSAGE_HANDLER(EflViewMsg_SetCache, OnSetCache) + IPC_MESSAGE_HANDLER(EwkProcessMsg_SetExtensibleAPI, OnSetExtensibleAPI) + IPC_MESSAGE_HANDLER(EwkProcessMsg_UpdateTizenExtensible, + OnUpdateTizenExtensible) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -61,3 +65,12 @@ void RenderThreadObserverEfl::OnSetCache(const CacheParamsEfl& params) #endif } +void RenderThreadObserverEfl::OnSetExtensibleAPI(const std::string& api_name, + bool enable) { + TizenExtensible::GetInstance()->SetExtensibleAPI(api_name, enable); +} + +void RenderThreadObserverEfl::OnUpdateTizenExtensible( + const std::map& params) { + TizenExtensible::GetInstance()->UpdateTizenExtensible(params); +} \ No newline at end of file diff --git a/tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.h b/tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.h index fbd136a..eb7ead7 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.h +++ b/tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.h @@ -5,6 +5,7 @@ #ifndef RENDER_THREAD_OBSERVER_EFL_H #define RENDER_THREAD_OBSERVER_EFL_H +#include #include #include "base/compiler_specific.h" @@ -22,10 +23,12 @@ public: explicit RenderThreadObserverEfl(ContentRendererClientEfl* content_client); bool OnControlMessageReceived(const IPC::Message& message) override; void OnClearCache(); - + private: void OnSetCache(const CacheParamsEfl& params); ContentRendererClientEfl* content_client_; + void OnSetExtensibleAPI(const std::string& api_name, bool enable); + void OnUpdateTizenExtensible(const std::map& params); }; #endif diff --git a/tizen_src/ewk/efl_integration/renderer/tizen_extensible.cc b/tizen_src/ewk/efl_integration/renderer/tizen_extensible.cc new file mode 100644 index 0000000..8f764ab --- /dev/null +++ b/tizen_src/ewk/efl_integration/renderer/tizen_extensible.cc @@ -0,0 +1,59 @@ +// Copyright 2016 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "renderer/tizen_extensible.h" + +TizenExtensible::TizenExtensible() : + extensible_api_table_ { + { "background,music", true }, + { "background,vibration", false }, + { "block,multimedia,on,call", false}, + { "csp", false }, + { "encrypted,database", false }, + { "fullscreen", false }, + { "mediastream,record", false }, + { "media,volume,control", false }, + { "prerendering,for,rotation", false }, + { "rotate,camera,view", true }, + { "rotation,lock", false }, + { "sound,mode", false }, + { "support,fullscreen", true }, + { "visibility,suspend", false }, + { "xwindow,for,fullscreen,video", false }, + { "support,multimedia", true }, + }, + initialized_(false) { +} + +TizenExtensible::~TizenExtensible() { + extensible_api_table_.clear(); +} + +void TizenExtensible::UpdateTizenExtensible( + const std::map& params) { + extensible_api_table_.clear(); + extensible_api_table_ = params; + initialized_ = true; +} + +bool TizenExtensible::SetExtensibleAPI(const std::string& api_name, + bool enable) { + auto it = extensible_api_table_.find(api_name); + if (it == extensible_api_table_.end()) + return false; + it->second = enable; + + return true; +} + +bool TizenExtensible::GetExtensibleAPI(const std::string& api_name) const { + if (!initialized_) + return false; + + auto it = extensible_api_table_.find(api_name); + if (it == extensible_api_table_.end()) + return false; + + return it->second; +} diff --git a/tizen_src/ewk/efl_integration/renderer/tizen_extensible.h b/tizen_src/ewk/efl_integration/renderer/tizen_extensible.h new file mode 100644 index 0000000..974d877 --- /dev/null +++ b/tizen_src/ewk/efl_integration/renderer/tizen_extensible.h @@ -0,0 +1,36 @@ +// Copyright 2016 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EWK_EFL_INTEGRATION_RENDERER_TIZEN_EXTENSIBLE_H_ +#define EWK_EFL_INTEGRATION_RENDERER_TIZEN_EXTENSIBLE_H_ + +#include +#include + +#include "base/memory/singleton.h" + +class TizenExtensible { + public: + static TizenExtensible* GetInstance() { + return base::Singleton::get(); + } + void UpdateTizenExtensible(const std::map& params); + + // Tizen Extensible API + bool SetExtensibleAPI(const std::string& api_name, bool enable); + bool GetExtensibleAPI(const std::string& api_name) const; + + private: + TizenExtensible(); + ~TizenExtensible(); + + TizenExtensible(const TizenExtensible&) = delete; + TizenExtensible& operator=(const TizenExtensible&) = delete; + + std::map extensible_api_table_; + bool initialized_; + friend struct base::DefaultSingletonTraits; +}; + +#endif // EWK_EFL_INTEGRATION_RENDERER_TIZEN_EXTENSIBLE_H_ -- 2.7.4