[M108 Migration] Add public EWK APIs for multimedia and refactor TizenExtensibleAPI 30/286530/3
authorayush.k123 <ayush.k123@samsung.com>
Mon, 9 Jan 2023 04:09:46 +0000 (09:39 +0530)
committerBot Blink <blinkbot@samsung.com>
Tue, 10 Jan 2023 03:19:43 +0000 (03:19 +0000)
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 <ayush.k123@samsung.com>
13 files changed:
tizen_src/ewk/efl_integration/BUILD.gn
tizen_src/ewk/efl_integration/browser/tizen_extensible_host.cc [new file with mode: 0644]
tizen_src/ewk/efl_integration/browser/tizen_extensible_host.h [new file with mode: 0644]
tizen_src/ewk/efl_integration/common/render_messages_ewk.h
tizen_src/ewk/efl_integration/common/tizen_extensible.cc [deleted file]
tizen_src/ewk/efl_integration/common/tizen_extensible.h [deleted file]
tizen_src/ewk/efl_integration/eweb_context.cc
tizen_src/ewk/efl_integration/eweb_context.h
tizen_src/ewk/efl_integration/public/ewk_context.cc
tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.cc
tizen_src/ewk/efl_integration/renderer/render_thread_observer_efl.h
tizen_src/ewk/efl_integration/renderer/tizen_extensible.cc [new file with mode: 0644]
tizen_src/ewk/efl_integration/renderer/tizen_extensible.h [new file with mode: 0644]

index ffbec1e..1a195b6 100644 (file)
@@ -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 (file)
index 0000000..fc6173e
--- /dev/null
@@ -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<TizenExtensibleHost>::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<content::RenderProcessHost>(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 (file)
index 0000000..b4e8387
--- /dev/null
@@ -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 <map>
+#include <set>
+#include <string>
+
+#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<int> renderers_;
+  std::map<std::string, bool> extensible_api_table_;
+  friend struct base::DefaultSingletonTraits<TizenExtensibleHost>;
+};
+
+#endif  // EWK_EFL_INTEGRATION_BROWSER_TIZEN_EXTENSIBLE_HOST_H
index 2e73e7e..273fd8a 100644 (file)
@@ -24,6 +24,7 @@
 #include "ipc_message_start_ewk.h"
 
 typedef std::map<std::string, std::string> StringMap;
+typedef std::map<std::string, bool> 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 (file)
index 9efec1f..0000000
+++ /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 (file)
index 91cf208..0000000
+++ /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 <string>
-#include <unordered_map>
-
-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<std::string, bool> extensible_API_table_;
-};
-
-#endif // TIZEN_EXTENSIBLE_h
index 4b77984..10786a8 100644 (file)
@@ -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);
 }
index 73742b9..f600b6b 100644 (file)
@@ -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<WebCacheManagerEfl> web_cache_manager_;
   std::unique_ptr<content::BrowserContextEfl> browser_context_;
   std::unique_ptr<Ewk_Cookie_Manager> ewk_cookie_manager_;
-  std::unique_ptr<TizenExtensible> tizen_extensible_;
   std::unique_ptr<EwkFaviconDatabase> ewk_favicon_database_;
   std::string proxy_uri_;
   std::string proxy_username_;
index 57bd33d..c7c1e79 100644 (file)
@@ -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)
index aef91b4..5b789ea 100644 (file)
@@ -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<std::string, bool>& params) {
+  TizenExtensible::GetInstance()->UpdateTizenExtensible(params);
+}
\ No newline at end of file
index fbd136a..eb7ead7 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef RENDER_THREAD_OBSERVER_EFL_H
 #define RENDER_THREAD_OBSERVER_EFL_H
 
+#include <map>
 #include <string>
 
 #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<std::string, bool>& 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 (file)
index 0000000..8f764ab
--- /dev/null
@@ -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<std::string, bool>& 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 (file)
index 0000000..974d877
--- /dev/null
@@ -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 <map>
+#include <string>
+
+#include "base/memory/singleton.h"
+
+class TizenExtensible {
+ public:
+  static TizenExtensible* GetInstance() {
+    return base::Singleton<TizenExtensible>::get();
+  }
+  void UpdateTizenExtensible(const std::map<std::string, bool>& 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<std::string, bool> extensible_api_table_;
+  bool initialized_;
+  friend struct base::DefaultSingletonTraits<TizenExtensible>;
+};
+
+#endif  // EWK_EFL_INTEGRATION_RENDERER_TIZEN_EXTENSIBLE_H_