* @file BoxManager.cpp
* @author Yunchan Cho (yunchan.cho@samsung.com)
*/
+#include <string>
#include <map>
#include <ewk_context.h>
#include <Plugin/IBoxPluginFactory.h>
result = requestChangePeriod(boxInfo->instanceId, boxInfo->period);
break;
case REQUEST_CMD_UPDATE_BOX:
- result = requestUpdateBox(boxInfo->instanceId);
+ result = requestUpdateBox(boxInfo->boxId);
break;
default:
LogD("not available request type");
return box->changePeriod(period);
}
-bool BoxManager::requestUpdateBox(std::string& instanceId)
+bool BoxManager::requestUpdateBox(std::string& boxId)
{
LogD("enter");
- IBoxPtr box = searchBoxMap(instanceId);
- if (!box) {
- return false;
+
+ IBoxPtr box;
+ box.reset();
+ 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();
}
- return box->update();
+ return true;
}
void BoxManager::insertBoxMap(std::string& instanceId, IBoxPtr box)