Merge commit 'refs/changes/76/40776/1' of ssh://review.tizen.org:29418/profile/tv... 14/40914/1
authorsungwon2.han <sungwon2.han@samsung.com>
Wed, 10 Jun 2015 06:25:15 +0000 (15:25 +0900)
committersungwon2.han <sungwon2.han@samsung.com>
Wed, 10 Jun 2015 08:13:25 +0000 (17:13 +0900)
Change-Id: I2b63e5a00bb1b57f35758724e1bdb9ece680c663

1  2 
core/AbstractWebEngine/AbstractWebEngine.h
services/SimpleUI/CMakeLists.txt
services/SimpleUI/SimpleUI.cpp
services/SimpleUI/SimpleUI.h
services/WebKitEngineService/WebKitEngineService.cpp
services/WebKitEngineService/WebKitEngineService.h
services/WebKitEngineService/WebView.cpp
services/WebKitEngineService/WebView.h

@@@ -342,6 -347,6 +347,12 @@@ public
       * All links to RSS/Atom channels were gathered from webpage.
       */
      boost::signals2::signal<void (std::vector<std::string>)> gotFeedLinks;
++
++    /**
++     * Status of IME
++     * \param bool true if IME is opened, false otherwise
++     */
++    boost::signals2::signal<void (bool)> IMEStateChanged;
  };
  
  } /* end of basic_webengine */
Simple merge
@@@ -67,9 -67,8 +67,10 @@@ SimpleUI::SimpleUI(/*Evas_Object *windo
      , m_currentZoom(ZOOM_TYPE_100)
      , items_vector()
      , m_networkErrorPopup(0)
++    , m_wvIMEStatus(false)
  {
      elm_init(static_cast<int>(NULL), static_cast<char**>(NULL));
 +    ewk_context_default_get();
      Evas_Object *main_window = elm_win_util_standard_add("browserApp", "browserApp");
      if (main_window == NULL)
          BROWSER_LOGE("Failed to create main window");
@@@ -251,6 -253,6 +255,7 @@@ int SimpleUI::exec(const std::string& _
              m_webEngine->favIconChanged.connect(boost::bind(&SimpleURI::setFavIcon, m_simpleURI.get(), _1));
              m_webEngine->favIconChanged.connect(boost::bind(&WebTitleBar::setFavIcon, webTitleBar.get(), _1));
              m_webEngine->titleChanged.connect(boost::bind(&WebTitleBar::show, webTitleBar.get(), _1));
++            m_webEngine->IMEStateChanged.connect(boost::bind(&SimpleUI::setwvIMEStatus, this, _1));
  
              m_favoriteService->bookmarkAdded.connect(boost::bind(&SimpleUI::onBookmarkAdded, this,_1));
              m_favoriteService->bookmarkDeleted.connect(boost::bind(&SimpleUI::onBookmarkRemoved, this, _1));
@@@ -609,7 -611,13 +614,20 @@@ void SimpleUI::onReturnPressed(MenuButt
      hidePopup.disconnect_all_slots();
      m->hidePopup();
  }
- */
++void SimpleUI::setwvIMEStatus(bool status) 
++{
++    BROWSER_LOGD("[%s]", __func__);
++    m_wvIMEStatus = status;
++}
++
+ void SimpleUI::onBackPressed()
+ {
+     BROWSER_LOGD("[%s]", __func__);
 -    m_webEngine->backButtonClicked();
++    if (!m_simpleURI->hasFocus() && !m_wvIMEStatus)
++        m_webEngine->backButtonClicked();
+ }
  void SimpleUI::backEnable(bool enable)
  {
      m_back->setEnabled(enable);
@@@ -132,6 -132,6 +132,8 @@@ private
  
      void loadThemes();
  
++    void setwvIMEStatus(bool status);
++
  
  
      sharedAction m_back;
      zoom_type m_currentZoom;
      int m_tabLimit;
      int m_favoritesLimit;
++    bool m_wvIMEStatus;
  
      std::vector<std::shared_ptr<tizen_browser::services::HistoryItem>> items_vector;
      std::unique_ptr<tizen_browser::basic_ui::NetworkErrorHandler> m_netErrorHandler;
@@@ -84,6 -85,6 +85,7 @@@ void WebKitEngineService::connectSignal
      webView->backwardEnableChanged.connect(boost::bind(&WebKitEngineService::_backwardEnableChanged, this, _1));
      webView->cofirmationRequest.connect(boost::bind(&WebKitEngineService::_confirmationRequest, this, _1));
      webView->ewkViewClicked.connect(boost::bind(&WebKitEngineService::webViewClicked, this));
++    webView->IMEStateChanged.connect(boost::bind(&WebKitEngineService::_IMEStateChanged, this, _1));
  }
  
  void WebKitEngineService::disconnectSignals(std::shared_ptr<WebView> webView)
      webView->backwardEnableChanged.disconnect(boost::bind(&WebKitEngineService::_backwardEnableChanged, this, _1));
      webView->cofirmationRequest.disconnect(boost::bind(&WebKitEngineService::_confirmationRequest, this, _1));
      webView->ewkViewClicked.disconnect(boost::bind(&WebKitEngineService::webViewClicked, this));
++    webView->IMEStateChanged.disconnect(boost::bind(&WebKitEngineService::_IMEStateChanged, this, _1));
  }
  
  void WebKitEngineService::disconnectCurrentWebViewSignals()
@@@ -477,6 -478,16 +480,21 @@@ void WebKitEngineService::searchOnWebsi
      m_currentWebView->searchOnWebsite(searchString, flags);
  }
  
 -    if(isBackEnabled()) {
 -        M_ASSERT(m_currentWebView);
++void WebKitEngineService::_IMEStateChanged(bool enable)
++{
++    IMEStateChanged(enable);
++}
++
+ void WebKitEngineService::backButtonClicked() const
+ {
++    M_ASSERT(m_currentWebView);
++    if (isBackEnabled()) {     
+         m_currentWebView->back();
+     } else {
+         app_efl_exit();
+     }
+ }
  } /* end of webkitengine_service */
  } /* end of basic_webengine */
  } /* end of tizen_browser */
@@@ -168,6 -173,6 +173,7 @@@ private
      void _backwardEnableChanged(bool);
      void _loadProgress(double);
      void _confirmationRequest(WebConfirmationPtr) ;
++    void _IMEStateChanged(bool);
      void webViewClicked();
  
      /**
@@@ -60,7 -60,7 +60,7 @@@ WebView::WebView(Evas_Object * obj, Tab
      , m_isLoading(false)
      , m_loadError(false)
  {
--  config.load("whatever");
++    config.load("whatever");
  }
  
  WebView::~WebView()
@@@ -746,6 -752,16 +752,20 @@@ void WebView::onFaviconChaged(void* dat
      }
  }
  
+ void WebView::__IMEClosed(void* data, Evas_Object*, void*)
+ {
+     BROWSER_LOGD("%s", __func__);
++    WebView * self = reinterpret_cast<WebView *>(data);
++    self->IMEStateChanged(false);
+ }
+ void WebView::__IMEOpened(void* data, Evas_Object*, void*)
+ {
+     BROWSER_LOGD("%s", __func__);
++    WebView * self = reinterpret_cast<WebView *>(data);
++    self->IMEStateChanged(true);
+ }
  std::string WebView::securityOriginToUri(const Ewk_Security_Origin *origin)
  {
      std::string protocol = tizen_browser::tools::fromChar(ewk_security_origin_protocol_get(origin));
@@@ -134,6 -134,6 +134,8 @@@ public
  
      boost::signals2::signal<void ()> ewkViewClicked;
  
++    boost::signals2::signal<void (bool)> IMEStateChanged;
++
  private:
      void registerCallbacks();
      void unregisterCallbacks();