: m_window()
{}
- virtual int exec(const std::string& url, const std::string& caller) = 0;
+ virtual int exec(
+ const std::string& url,
+ const std::string& caller,
+ const std::string& operation) = 0;
std::shared_ptr<T> getMainWindow(){return m_window;};
/**
if ((operation && !strcmp(operation, APP_CONTROL_OPERATION_SEARCH )) &&
((app_control_get_extra_data(app_control, "http://tizen.org/appcontrol/data/keyword", &search_keyword) == APP_CONTROL_ERROR_NONE) ||
- (app_control_get_extra_data(app_control, APP_CONTROL_DATA_TEXT, &search_keyword) == APP_CONTROL_ERROR_NONE))) {
+ (app_control_get_extra_data(app_control, APP_CONTROL_DATA_TEXT, &search_keyword) == APP_CONTROL_ERROR_NONE))) {
BROWSER_LOGD("APP_CONTROL_OPERATION_SEARCH");
if (search_keyword) {
uri=std::string(search_keyword);
free(search_keyword);
}
}
-
+ std::string oper(operation);
BROWSER_LOGD("[%s] uri=%s", __func__, uri.c_str());
free(request_uri);
free(request_mime_type);
free(operation);
auto bd = static_cast<BrowserDataPtr*>(app_data);
- (*bd)->exec(uri, caller);
+ (*bd)->exec(uri, caller, oper);
evas_object_show((*bd)->getMainWindow().get());
elm_win_activate((*bd)->getMainWindow().get());
}
#endif
-int SimpleUI::exec(const std::string& _url, const std::string& _caller)
-{
- BROWSER_LOGD("[%s] _url=%s, _caller=%s, initialised=%d", __func__, _url.c_str(), _caller.c_str(), m_initialised);
+int SimpleUI::exec(const std::string& _url, const std::string& _caller, const std::string& _operation)
+{
+ BROWSER_LOGD(
+ "[%s] _url=%s, _caller=%s, _operation=%s, initialised=%d",
+ __func__,
+ _url.c_str(),
+ _caller.c_str(),
+ _operation.c_str(),
+ m_initialised);
std::string url = _url;
+ std::string operation = _operation;
m_caller = _caller;
m_alreadyOpenedExecURL = false;
- m_functionViewPrepare = [url, this]() mutable {
+ m_functionViewPrepare = [url, operation, this]() mutable {
if (!m_initialised) {
if (m_window.get()) {
prepareServices();
if (!pwaUrl.empty() || (!url.empty() && !m_alreadyOpenedExecURL)) {
BROWSER_LOGD("[%s]: open new tab", __func__);
- auto taburl = pwaUrl.empty() ? url : pwaUrl;
+ std::string newUrl = url;
+ if (!operation.compare(APP_CONTROL_OPERATION_SEARCH)) {
+ newUrl = m_webPageUI->getURIEntry().rewriteURI(url);
+ popStackTo(m_webPageUI);
+ }
+ auto taburl = pwaUrl.empty() ? newUrl : pwaUrl;
#if PWA
// Allow for only one instance of PWA
if (m_alreadyOpenedPWA)
public:
SimpleUI(/*Evas_Object *window*/);
virtual ~SimpleUI();
- int exec(const std::string& _url, const std::string& _caller) final override;
- std::string getName() final override;
+ virtual int exec(
+ const std::string& _url,
+ const std::string& _caller,
+ const std::string& _operation) final override;
+ virtual std::string getName() final override;
void suspend();
void resume();
void destroyUI();