ecore window handle storage
authorLukasz Marek <l.marek@samsung.com>
Tue, 23 Apr 2013 12:47:03 +0000 (14:47 +0200)
committerLukasz Marek <l.marek@samsung.com>
Tue, 23 Apr 2013 15:58:55 +0000 (17:58 +0200)
[Issue#] N/A
[Bug] N/A
[Problem] WebProcess need to store window handle to allow inline disposition
          when called by native applications.
[Solution] Add variable in plugin_logic to store ecore window handle.
           PluginLogic is a singleton available in WebProcess.
[Verification] Build wrt-plugins-common repository

Change-Id: Ieef2e8f0257bfae44b9905e6c5fe544ce6d8cabe

src/plugin-loading/plugin_logic.cpp
src/plugin-loading/plugin_logic.h

index c3bf0fd..08d056a 100644 (file)
@@ -75,6 +75,7 @@ class PluginLogic::Impl
 
     typedef std::map<JSContextRef, JSPageSessionPtr> PagesSessionsSet;
     PagesSessionsSet m_sessions;
+    unsigned int m_windowHandle;
 
   public:
     Impl();
@@ -108,6 +109,9 @@ class PluginLogic::Impl
                                  CustomEventType eventType,
                                  void* data);
 
+    unsigned int windowHandle() const;
+    void setWindowHandle(unsigned int handle);
+
     static bool s_sanityCheck;
 };
 
@@ -122,7 +126,8 @@ bool PluginLogic::Impl::s_sanityCheck = false;
         return; \
     }
 
-PluginLogic::Impl::Impl()
+PluginLogic::Impl::Impl() :
+    m_windowHandle(0)
 {
     s_sanityCheck = true;
 
@@ -225,6 +230,16 @@ void PluginLogic::unloadFrame(JSGlobalContextRef context)
     m_impl->unloadFrame(context);
 }
 
+unsigned int PluginLogic::windowHandle() const
+{
+    return m_impl->windowHandle();
+}
+
+void PluginLogic::setWindowHandle(unsigned int handle)
+{
+    m_impl->setWindowHandle(handle);
+}
+
 PluginLogic::PluginLogic() : m_impl(new PluginLogic::Impl())
 {}
 
@@ -415,3 +430,16 @@ void PluginLogic::Impl::dispatchJavaScriptEvent(JSGlobalContextRef context,
 
     sessionIt->second->dispatchJavaScriptEvent(eventType, data);
 }
+
+unsigned int PluginLogic::Impl::windowHandle() const
+{
+    PLUGIN_LOGIC_SANITY_CHECK
+    return m_windowHandle;
+}
+
+void PluginLogic::Impl::setWindowHandle(unsigned int handle)
+{
+    PLUGIN_LOGIC_SANITY_CHECK
+    LogDebug("XWindow handle " << handle);
+    m_windowHandle = handle;
+}
index 10bcb08..fb965c5 100644 (file)
@@ -80,6 +80,9 @@ class PluginLogic : DPL::Noncopyable
                                  CustomEventType eventType,
                                  void* data);
 
+    unsigned int windowHandle() const;
+    void setWindowHandle(unsigned int handle);
+
   private:
     PluginLogic();
     ~PluginLogic();