Fixed not displaying thumbnails on Most visited screen. 28/47228/2 accepted/tizen/tv/20150902.004909 submit/tizen_tv/20150901.234711
authorMaciej Skrzypkowski <m.skrzypkows@samsung.com>
Tue, 1 Sep 2015 07:28:14 +0000 (09:28 +0200)
committerMaciej Skrzypkowski <m.skrzypkows@samsung.com>
Tue, 1 Sep 2015 09:10:01 +0000 (02:10 -0700)
[Issue#] https://bugs.tizen.org/jira/browse/TT-73
[Problem] There was no thumbnails on main screen.
[Cause] Website thumbnail was not saved and not fetched.
[Solution] Added saving thumbnail on page finish loading and fetching it
for Most visited screen.
[Verify] Visit few different sites (wait until page is fully loaded) > open
the Most visited screen, check if there are thumbnails.

Change-Id: I8d8e648df0d1314fa772e5519ee07a06e795bc63
Signed-off-by: Maciej Skrzypkowski <m.skrzypkows@samsung.com>
services/HistoryService/HistoryService.cpp
services/MainUI/MainUI.cpp
services/MainUI/MainUI.h
services/SimpleUI/SimpleUI.cpp

index 021c1e5..e3d2a82 100644 (file)
@@ -185,13 +185,10 @@ std::shared_ptr<HistoryItemVector> HistoryService::getMostVisitedHistoryItems()
         BROWSER_LOGD("Error! Could not get ids!");
     }
 
-    bp_history_offset offset = (BP_HISTORY_O_URL | BP_HISTORY_O_TITLE | BP_HISTORY_O_FAVICON | BP_HISTORY_O_DATE_CREATED);
+    bp_history_offset offset = (BP_HISTORY_O_URL | BP_HISTORY_O_TITLE | BP_HISTORY_O_FAVICON | BP_HISTORY_O_DATE_CREATED | BP_HISTORY_O_THUMBNAIL);
 
     int freq_arr[1000];
     for(int i = 0; i< count; i++){
-        bp_history_info_fmt history_info;
-        bp_history_adaptor_get_info(ids[i],offset,&history_info);
-
         int freq;
         if (0 == bp_history_adaptor_get_frequency(ids[i], &freq))
         {
@@ -232,7 +229,7 @@ std::shared_ptr<HistoryItemVector> HistoryService::getMostVisitedHistoryItems()
 
         //thumbail
         std::shared_ptr<tizen_browser::tools::BrowserImage> hi = std::make_shared<tizen_browser::tools::BrowserImage>();
-        hi->imageType = tizen_browser::tools::BrowserImage::ImageType::ImageTypePNG;
+        hi->imageType = tools::BrowserImage::ImageTypePNG;
         hi->width = history_info.thumbnail_width;
         hi->height = history_info.thumbnail_height;
         hi->dataSize = history_info.thumbnail_length;
index 1657295..74a2c52 100644 (file)
@@ -33,6 +33,8 @@ namespace base_ui{
 
 const int SMALL_TILES_ROWS = 2;
 const int MAX_TILES_NUMBER = 5;
+const int MainUI::MAX_TILE_WIDTH = 784;
+const int MainUI::MAX_TILE_HEIGHT = 498;
 
 EXPORT_SERVICE(MainUI, "org.tizen.browser.mainui")
 
index 4ec341a..352051d 100644 (file)
@@ -60,6 +60,9 @@ public:
     boost::signals2::signal<void (const std::string & )> mostVisitedClicked;
     boost::signals2::signal<void (const std::string & )> bookmarkClicked;
     boost::signals2::signal<void (const std::string & )> bookmarkManagerClicked;
+
+    static const int MAX_TILE_WIDTH;
+    static const int MAX_TILE_HEIGHT;
 private:
 
     void createItemClasses();
index add69f3..6f0abe5 100644 (file)
@@ -793,7 +793,7 @@ void SimpleUI::loadFinished()
     if(!m_webEngine->isPrivateMode()){
         m_historyService->addHistoryItem(std::make_shared<tizen_browser::services::HistoryItem> (m_webEngine->getURI(),
                                                                                                 m_webEngine->getTitle(),
-                                                                                                m_webEngine->getFavicon()));
+                                                                                                m_webEngine->getFavicon()), m_webEngine->getSnapshotData(MainUI::MAX_TILE_WIDTH, MainUI::MAX_TILE_HEIGHT));
     }
 #if 0
     if(!m_platformInputManager->getPointerModeEnabled())