Change proxy setting
authorHyunseok Yang <hs0219.yang@samsung.com>
Tue, 3 Sep 2013 05:12:25 +0000 (14:12 +0900)
committerHyunseok Yang <hs0219.yang@samsung.com>
Tue, 3 Sep 2013 05:35:24 +0000 (14:35 +0900)
Change-Id: I442b723208424c4b45463d05644c6fd93075b84e
Signed-off-by: Hyunseok Yang <hs0219.yang@samsung.com>
src/controls/FWebCtrl_EflWebkit.cpp
src/controls/FWebCtrl_EflWebkit.h
src/controls/FWebCtrl_Web.cpp
src/controls/FWebCtrl_Web.h
src/controls/FWebCtrl_WebManager.cpp
src/controls/FWebCtrl_WebManager.h

index 014bd33..120c7cf 100755 (executable)
@@ -173,8 +173,8 @@ _EflWebkit::SetWebConfiguration(void) const
        r = InitializeCustomDb();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = SetProxyAddress();
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+//     r = SetProxyAddress();
+//     SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        InitializeCustomHeader();
 
@@ -276,23 +276,8 @@ _EflWebkit::InitializeCustomDb(void) const
 
 
 result
-_EflWebkit::SetProxyAddress(void) const
+_EflWebkit::SetProxyAddress(char* pProxy) const
 {
-       int ret = -1;
-       connection_h handle = null;
-
-       ret = connection_create(&handle);
-       SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to create connection.");
-
-       char* pProxy = null;
-       connection_address_family_e family = CONNECTION_ADDRESS_FAMILY_IPV4;
-
-       ret = connection_get_proxy(handle, family, &pProxy);
-       SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to get proxy address.");
-
-       ret = connection_destroy(handle);
-       SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to destroy connection.");
-
        Ewk_Context* pContext = ewk_view_context_get(__pWebFrame);
        SysAssertf(pContext, "Failed to get context.");
 
@@ -307,11 +292,6 @@ _EflWebkit::SetProxyAddress(void) const
 
        SysLog(NID_WEB_CTRL, "The current value of proxy is %s", pProxy);
 
-       if (pProxy)
-       {
-               free(pProxy);
-       }
-
        return E_SUCCESS;
 }
 
index e4cee87..8b5dbbf 100755 (executable)
@@ -66,6 +66,8 @@ public:
 
        Evas_Object* GetWebEvasObject(void) const;
 
+       result SetProxyAddress(char* pProxy) const;
+
 //     result GetPixelBufferFromEvasObject(const Evas_Object* source, Tizen::Graphics::BufferInfo& bufferInfo);
 
 private:
@@ -73,8 +75,6 @@ private:
 
        result SetWebConfiguration(void) const;
 
-       result SetProxyAddress(void) const;
-
        result CreateResourceDirectory(void) const;
 
        result InitializeCustomDb(void) const;
index 7e6add7..0d96d70 100755 (executable)
@@ -604,6 +604,12 @@ _Web::GetSetting(void) const
        return __pWebSetting.get();
 }
 
+_EflWebkit*
+_Web::GetEflWebkit(void) const
+{
+       return __pEflWebkit.get();
+}
+
 
 result
 _Web::OnAttaching(const _Control* pParent)
index 6d86ef8..aaec2cc 100755 (executable)
@@ -113,6 +113,8 @@ public:
 
        WebSetting* GetSetting(void) const;
 
+       _EflWebkit* GetEflWebkit(void) const;
+
        void SetEdgeReachedEvent(_WebEdgeType type);
 
        void SetFullScreenEntered(bool isFullScreenEntered);
index d62b8c7..e530eb4 100755 (executable)
  *\r
  * The file contains the definition of _WebManager class.\r
  */\r
-\r
+#include <net_connection.h>\r
 #include <FBaseSysLog.h>\r
 #include <FUiControl.h>\r
 #include <FUiCtrl_FormImpl.h>\r
+#include "FWebCtrl_EflWebkit.h"\r
+#include "FWebCtrl_Web.h"\r
 #include "FWebCtrl_WebImpl.h"\r
 #include "FWebCtrl_WebManager.h"\r
 #include "FWebCtrl_WebPopup.h"\r
@@ -42,11 +44,13 @@ _WebManager::_WebManager(void)
        , __pCallbackList(null)\r
        , __pActiveWeb(null)\r
        , __pActivePopup(null)\r
+       , __pProxy(null)\r
 {\r
 }\r
 \r
 _WebManager::~_WebManager(void)\r
 {\r
+       free(__pProxy);\r
 }\r
 \r
 _WebManager*\r
@@ -78,6 +82,10 @@ _WebManager::Construct(void)
 {\r
        result r = E_SUCCESS;\r
 \r
+       int ret = -1;\r
+       connection_h handle = null;\r
+       char* pProxy = null;\r
+\r
        std::unique_ptr<ArrayListT< int> > pWebList(new (std::nothrow) ArrayListT< int >());\r
        SysTryReturnResult(NID_WEB_CTRL, pWebList.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");\r
        r = pWebList->Construct();\r
@@ -87,9 +95,21 @@ _WebManager::Construct(void)
        SysTryReturnResult(NID_WEB_CTRL, pCallbackList.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");\r
        r = pCallbackList->Construct();\r
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
+
+       ret = connection_create(&handle);
+       SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to create connection.");
+\r
+       connection_address_family_e family = CONNECTION_ADDRESS_FAMILY_IPV4;
+
+       ret = connection_get_proxy(handle, family, &pProxy);
+       SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to get proxy address.");
+
+       ret = connection_destroy(handle);
+       SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to destroy connection.");\r
 \r
        __pWebList = std::move(pWebList);\r
        __pCallbackList = std::move(pCallbackList);\r
+       __pProxy = pProxy;\r
 \r
        return E_SUCCESS;\r
 }\r
@@ -99,6 +119,14 @@ _WebManager::AddWeb(int webAdress)
 {\r
        result r = E_SUCCESS;\r
 \r
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(webAdress);\r
+\r
+       _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));\r
+\r
+       r = pWebCore->GetEflWebkit()->SetProxyAddress(__pProxy);\r
+\r
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
+\r
        r = __pWebList->Add(webAdress);\r
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
 \r
index 3519729..967a275 100755 (executable)
@@ -65,6 +65,7 @@ private:
 \r
        _WebImpl* __pActiveWeb;\r
        _WebPopup* __pActivePopup;\r
+       char* __pProxy;\r
 };\r
 \r
 } } }\r