X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FCore%2FBoxManager.cpp;h=b6f3e17f6c55cea2b1818f0b5183084892dd89d3;hb=57061bb40c2acd370fc8d815910f374c2749a5c7;hp=e600678d1a5a3599b8b9303dc487a2f82571a5b0;hpb=bcc793712d4c2f01114b3a067c4d59c929c60b3a;p=platform%2Fframework%2Fweb%2Fweb-provider.git diff --git a/src/Core/BoxManager.cpp b/src/Core/BoxManager.cpp index e600678..b6f3e17 100644 --- a/src/Core/BoxManager.cpp +++ b/src/Core/BoxManager.cpp @@ -1,11 +1,11 @@ /* * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved * - * Licensed under the Flora License, Version 1.0 (the "License"); + * Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.tizenopensource.org/license + * http://floralicense.org/license/ * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -17,7 +17,9 @@ * @file BoxManager.cpp * @author Yunchan Cho (yunchan.cho@samsung.com) */ +#include #include +#include #include #include #include @@ -65,7 +67,9 @@ bool BoxManager::doCommand(const request_cmd_type type, const BoxInfoPtr& boxInf result = requestPauseAll(); break; case REQUEST_CMD_OPEN_PD: - result = requestOpenPd(boxInfo->instanceId, boxInfo->pdWidth, boxInfo->pdHeight); + result = requestOpenPd(boxInfo->instanceId, + boxInfo->pdWidth, boxInfo->pdHeight, + boxInfo->pdX, boxInfo->pdY); break; case REQUEST_CMD_CLOSE_PD: result = requestClosePd(boxInfo->instanceId); @@ -73,6 +77,9 @@ bool BoxManager::doCommand(const request_cmd_type type, const BoxInfoPtr& boxInf case REQUEST_CMD_CHANGE_PERIOD: result = requestChangePeriod(boxInfo->instanceId, boxInfo->period); break; + case REQUEST_CMD_UPDATE_BOX: + result = requestUpdateBox(boxInfo->boxId, boxInfo->contentInfo); + break; default: LogD("not available request type"); break; @@ -154,14 +161,17 @@ bool BoxManager::requestPauseBox(std::string& instanceId) return false; } - return box->pause(); + // paused by switching other page + return box->pause(false); } bool BoxManager::requestResumeAll() { LogD("enter"); for (auto it = m_boxMap.begin(); it != m_boxMap.end(); it++) { - it->second->resume(); + if (it->second->isCurrentTab()) { + it->second->resume(); + } } return true; @@ -171,13 +181,18 @@ bool BoxManager::requestPauseAll() { LogD("enter"); for (auto it = m_boxMap.begin(); it != m_boxMap.end(); it++) { - it->second->pause(); + if (it->second->isCurrentTab()) { + // paused by entering background + it->second->pause(true); + } } return true; } -bool BoxManager::requestOpenPd(std::string& instanceId, int width, int height) +bool BoxManager::requestOpenPd( + std::string& instanceId, + int width, int height, double x, double y) { LogD("enter"); IBoxPtr box = searchBoxMap(instanceId); @@ -185,7 +200,7 @@ bool BoxManager::requestOpenPd(std::string& instanceId, int width, int height) return false; } - return box->openPd(width, height); + return box->openPd(width, height, x, y); } bool BoxManager::requestClosePd(std::string& instanceId) @@ -210,6 +225,26 @@ bool BoxManager::requestChangePeriod(std::string& instanceId, float period) return box->changePeriod(period); } +bool BoxManager::requestUpdateBox(std::string& boxId, std::string& contentInfo) +{ + LogD("enter"); + + IBoxPtr box; + box.reset(); + + time_t requestTime = time(NULL); + + for (auto it = m_boxMap.begin(); it != m_boxMap.end(); ++it) { + if (it->first.find(boxId) == std::string::npos) { + continue; + } + box = it->second; + box->update(requestTime, contentInfo); + } + + return true; +} + void BoxManager::insertBoxMap(std::string& instanceId, IBoxPtr box) { if (!searchBoxMap(instanceId)) {