Fix PWA launching 66/92966/1
authorKamil Nowac <k.nowac@samsung.com>
Wed, 19 Oct 2016 12:34:06 +0000 (14:34 +0200)
committerKamil Nowac <k.nowac@samsung.com>
Wed, 19 Oct 2016 13:34:17 +0000 (15:34 +0200)
[Issue]    N/A
[Problem]  PWA launch to the quick access
[Solution] Moved function
[Verify]   Launch pwa from the shortcut
           App should launch in the main screen

Change-Id: Ica42e2e2bb4badee4a8bfb096b4cb1ce18fef826

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

index 118bfb3d7231906c66147761b7d78ab42843042d..4f37399ca1480e2d5767643e3bf24694c239a588 100755 (executable)
@@ -136,10 +136,6 @@ void SimpleUI::resume()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     m_functionViewPrepare();
-    if (!m_isSessionRestored) {
-        switchViewToQuickAccess();
-        m_isSessionRestored = true;
-    }
 #if DUMMY_BUTTON
     m_webPageUI->createDummyButton();
 #endif
@@ -212,10 +208,11 @@ int SimpleUI::exec(const std::string& _url, const std::string& _caller)
         }
 #if PWA
             // Progressive web app
-            if (!strncmp(url.c_str(), "browser_shortcut:", strlen("browser_shortcut:"))) {
+            if (!strncmp(url.c_str(), "browser_shortcut::", strlen("browser_shortcut::"))) {
                 BROWSER_LOGD("Progressive web app");
                 m_pwa.preparePWAParameters(url);
                 url = m_pwa.getPWAinfo().uri;
+                BROWSER_LOGD("Display mode: %d", m_pwa.getPWAinfo().displayMode);
                 m_webPageUI->setDisplayMode(
                     static_cast<WebPageUI::WebDisplayMode>(
                         m_pwa.getPWAinfo().displayMode));
@@ -228,6 +225,7 @@ int SimpleUI::exec(const std::string& _url, const std::string& _caller)
 #endif
             if (url.empty()) {
                 BROWSER_LOGD("[%s]: restore last session", __func__);
+                switchViewToQuickAccess();
                 restoreLastSession();
             }
             m_initialised = true;
@@ -254,7 +252,6 @@ void SimpleUI::restoreLastSession()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
 
-    m_isSessionRestored = false;
     auto vec(m_tabService->getAllTabs());
     for (const auto& i : *vec) {
         openNewTab(
@@ -263,7 +260,6 @@ void SimpleUI::restoreLastSession()
             boost::optional<int>(i.getId().get()),
             false,
             i.getOrigin());
-        m_isSessionRestored = true;
     }
 }
 
index 20fa7ed50f7c24b0dc773d661f72d490dd71c355..9dac5a0e3e96e0fb23397f00093d6ab544660e22 100644 (file)
@@ -372,7 +372,6 @@ private:
     bool m_manualRotation;
     int m_current_angle;
     int m_temp_angle;
-    bool m_isSessionRestored;
     std::function<void()> m_functionViewPrepare;
     std::future<void> m_futureView;
     bool m_alreadyOpenedExecURL;