Revert "Revert "[Workaround] Highlight text color is gray"" 77/77477/2
authorHye Kyoung Hwang <cookie@samsung.com>
Thu, 30 Jun 2016 02:35:12 +0000 (19:35 -0700)
committerHye Kyoung Hwang <cookie@samsung.com>
Thu, 30 Jun 2016 02:35:14 +0000 (19:35 -0700)
This reverts commit 909739dbb63c1c3da9368e00645e8375586378eb.

Change-Id: Idf889da0b7e199fe6554853b44315769c6147c79

services/SimpleUI/SimpleUI.cpp
services/SimpleUI/SimpleUI.h

index 7da0394f1bc571ae1a55a0d658d69678b4db0d45..5b0327a30479cadae74b72376c153923a08bded3 100644 (file)
@@ -82,6 +82,7 @@ SimpleUI::SimpleUI()
     , m_tabLimit(0)
     , m_favoritesLimit(0)
     , m_wvIMEStatus(false)
+    , m_webEngineHadFocusBeforeSuspend(false)
 #if PROFILE_MOBILE
     , m_current_angle(0)
     , m_temp_angle(0)
@@ -129,18 +130,32 @@ SimpleUI::~SimpleUI() {
 
 void SimpleUI::suspend()
 {
+    //TODO: Delete when web_view fixed unfocus on suspend issue
+    m_webEngineHadFocusBeforeSuspend = m_webEngine->hasFocus();
     m_webEngine->suspend();
 }
 
 void SimpleUI::resume()
 {
     m_webEngine->resume();
+    //TODO: Delete when web_view fixed unfocus on suspend issue
+    if (m_webEngineHadFocusBeforeSuspend)
+        m_webEngineFocusWorkaroundTimer =  ecore_timer_add(0.0, web_view_set_focus_timer, this);
+
 #if PROFILE_MOBILE
     if (m_findOnPageUI && (evas_object_visible_get(m_findOnPageUI->getContent()) == EINA_TRUE))
         m_findOnPageUI->show_ime();
 #endif
 }
 
+Eina_Bool SimpleUI::web_view_set_focus_timer(void *data)
+{
+    BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+    SimpleUI * simpleUI = static_cast<SimpleUI*>(data);
+    simpleUI->m_webEngine->setFocus();
+    return ECORE_CALLBACK_CANCEL;
+}
+
 void SimpleUI::destroyUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
index c95b2c2643b87a2425091eea592ffd9a9b008e57..532a2d9969d0dfc639803fb2c2e6152dc329de6a 100644 (file)
@@ -87,6 +87,7 @@ public:
     void resume();
 
     void destroyUI();
+    static Eina_Bool web_view_set_focus_timer(void *data);
 private:
     // setup functions
     void loadUIServices();
@@ -360,6 +361,7 @@ private:
     int m_tabLimit;
     int m_favoritesLimit;
     bool m_wvIMEStatus;
+    bool m_webEngineHadFocusBeforeSuspend;
     std::string m_folder_name;
 
     //helper object used to view management
@@ -370,6 +372,7 @@ private:
     int m_current_angle;
     int m_temp_angle;
 #endif
+    Ecore_Timer* m_webEngineFocusWorkaroundTimer;
 };
 
 }