BuildRequires: pkgconfig(wrt-plugin-loading)
BuildRequires: pkgconfig(wrt-plugin-js-overlay)
BuildRequires: pkgconfig(dpl-encryption)
-BuildRequires: pkgconfig(wrt-popup-runner)
+BuildRequires: pkgconfig(wrt-popup-wrt-runner)
+BuildRequires: pkgconfig(wrt-popup-ace-runner)
## wrt-launchpad-daemon #######################################################
BuildRequires: pkgconfig(app-checker)
)
SET(WRT_BASIC_DEP
- dpl-popup-efl
dpl-efl
dpl-dbus-efl
dpl-event-efl
dpl-utils-efl
- wrt-popup-runner
+ wrt-popup-ace-runner
security-core
security-client
)
#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <dpl/exception.h>
-#include <dpl/popup/popup_controller.h>
#include <dpl/singleton_impl.h>
#include "localization_setting.h"
#include <dpl/wrt-dao-ro/global_config.h>
MainThreadSingleton::Instance().AttachDatabases();
ADD_PROFILING_POINT("attach databases", "stop");
- // Initialize popup manager
- DPL::Popup::PopupManagerSingleton::Instance().Initialize(
- DPL::Popup::PopupRendererPtr(new DPL::Popup::PopupRenderer));
-
LogDebug("Initialize finished");
} catch (const DPL::Exception& ex) {
LogError("Internal Error during screen preparation:");
m_ewkContext = 0;
}
MainThreadSingleton::Instance().DetachDatabases();
- // Deinitialize popup manager
- DPL::Popup::PopupManagerSingleton::Instance().Deinitialize();
m_initialized = false;
}
#include <dpl/wrt-dao-ro/global_config.h>
#include "global_logic.h"
#include <dpl/utils/wrt_global_settings.h>
-#include <dpl/popup/popup_controller.h>
#include <appcore-common.h>
#include <profiling_util.h>
#include <signal.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#include <runnable_widget_object_state.h>
#include <wrt_ocsp_api.h>
+#include <popup-runner/PopupInvoker.h>
namespace { //Anonymous
const wchar_t* BACKGROUND_ENABLED = L"background_enabled" ;
-class Popups : DPL::Popup::PopupControllerUser
-{
- public:
- void displayCertificateRevokedPopup()
- {
- using namespace DPL::Popup;
- CtrlPopupPtr popup =
- PopupControllerSingleton::Instance().CreatePopup();
- popup->SetTitle(_("IDS_IM_POP_WIDGET_REVOKED_TITLE"));
- popup->Append(new PopupObject::Label(
- _("IDS_IM_POP_WIDGET_REVOKED_ERROR")));
- popup->Append(new PopupObject::Button(_("IDS_IM_BUTTON_OK"), 0));
- ListenForAnswer(popup);
-
- PopupAnswerCallback cb =
- MakeAnswerCallback(this, &Popups::dummyCallback);
-
- ShowPopupEventShort event(popup, cb);
- CONTROLLER_POST_EVENT(PopupController, event);
- }
-
- void dummyCallback(const DPL::Popup::AnswerCallbackData& /*data*/)
- {
- }
-};
-
-Popups popupsDisplayer;
-
const std::string ACCESS_DENIED = _("IDS_BR_POP_ACCESS_DENIED");
const std::string ALREADY_RUNNING = _("IDS_BR_POP_ALREADY_RUNNING");
const std::string INVALID_LOCALE = _("IDS_IM_POP_INVALID_WIDGET_LOCALE");
return true;
} else {
if (!GlobalSettings::PopupsTestModeEnabled()) {
- popupsDisplayer.displayCertificateRevokedPopup();
+ Wrt::Popup::PopupInvoker().showInfo(
+ _("IDS_IM_POP_WIDGET_REVOKED_TITLE"),
+ _("IDS_IM_POP_WIDGET_REVOKED_ERROR"),
+ _("IDS_IM_BUTTON_OK"));
}
return false;
}
* @version 1.0
* @brief Implementation file for global context
*/
-#include <dpl/popup/popup_controller.h>
#include <global_context.h>
#include <global_logic.h>
// Touch all WebRuntime controllers
// Remember to always add here new singletons!
GlobalLogicSingleton::Instance().GetGlobalModel();
- DPL::Popup::PopupControllerSingleton::Instance().Touch();
// Start UI process rpc server
}
} // namespace GlobalContext
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WRT_POPUP_ENUM_H
-#define WRT_POPUP_ENUM_H
-
-namespace Wrt {
-enum PopupType {
- ACE_PROMPT = 1,
- YES_NO_PROMPT
-};
-}
-
-#endif
-
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "PopupInvoker.h"
-#include <sstream>
-#include <unistd.h>
-#include <stdio.h>
-#include <dpl/log/log.h>
-#include <dpl/waitable_handle.h>
-#include <dpl/binary_queue.h>
-#include <dpl/serialization.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include "PopupEnum.h"
-#include "PopupSerializer.h"
-
-namespace {
-const char *POPUP_EXEC = "/usr/bin/wrt-popup";
-}
-
-namespace Wrt {
-PopupInvoker::PopupInvoker() :
- m_inputName(tmpnam(NULL)),
- m_outputName(tmpnam(NULL))
-{
- Try
- {
- m_input.Create(m_inputName);
- m_output.Create(m_outputName);
- LogDebug("Pipes created");
- }
- Catch (DPL::Exception)
- {
- LogError("Cannot create pipes");
- }
-}
-
-PopupInvoker::~PopupInvoker()
-{
- Try
- {
- m_input.Destroy(m_inputName);
- m_output.Destroy(m_outputName);
- LogDebug("Pipes destroyed");
- }
- Catch (DPL::Exception)
- {
- LogError("Cannot destroy pipes");
- }
-}
-
-bool PopupInvoker::askYesNo(const std::string& title, const std::string& message)
-{
- Try
- {
- DPL::BinaryQueue data;
- PopupSerializer::appendArg(YES_NO_PROMPT, data);
- PopupSerializer::appendArg(title, data);
- PopupSerializer::appendArg(message, data);
- DPL::NamedInputPipe tmp;
- tmp.Open(m_outputName);
- m_output.Open(m_outputName);
- m_input.Open(m_inputName);
- m_output.Write(data, data.Size());
-
- executePopup();
-
- //Result from popup application is available. Read it.
- DPL::BinaryQueueAutoPtr resultData =
- m_input.Read(std::numeric_limits<std::size_t>::max());
- const int result = PopupSerializer::getIntArg(*resultData);
-
- LogDebug("Popup result is: " << result);
-
- Assert(resultData->Empty());
-
- tmp.Close();
- m_input.Close();
- m_output.Close();
-
- return (!!result);
- }
- Catch(DPL::Exception)
- {
- LogError("error occured");
- }
-
- return false;
-}
-
-void PopupInvoker::executePopup()
-{
- pid_t pid = fork();
- if (pid == -1)
- {
- //error occured
- LogError("Cannot display popup!");
- Assert(false);
- }
- if (pid == 0)
- {
- //child process
- int ret = execl(POPUP_EXEC,
- POPUP_EXEC,
- m_outputName.c_str(),
- m_inputName.c_str(),
- NULL);
- if (ret == -1) {
- //execl returns -1 on error
- LogError("Cannot display popup!");
- Assert(false);
- }
- }
-
- DPL::WaitableHandle handle = m_input.WaitableReadHandle();
- DPL::WaitForSingleHandle(handle);
-}
-} // Wrt
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WRT_POPUP_INVOKER_H
-#define WRT_POPUP_INVOKER_H
-
-#include <string>
-
-#include <dpl/named_input_pipe.h>
-#include <dpl/named_output_pipe.h>
-
-#include "popup_ace_data_types.h"
-
-/*
-
- Example usage:
-
- bool result = PopupInvoker().askYesNo("title", "message");
-
- */
-namespace Wrt {
-class PopupInvoker
-{
-public:
- class Exception
- {
- public:
- DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
- DECLARE_EXCEPTION_TYPE(Base, PopupInvokerException)
- };
-
- PopupInvoker();
- ~PopupInvoker();
-
- bool askYesNo(const std::string &title, const std::string &message);
-
-private:
-
- void executePopup();
-
- DPL::NamedInputPipe m_input;
- DPL::NamedOutputPipe m_output;
- const std::string m_inputName;
- const std::string m_outputName;
-};
-} // Wrt
-
-#endif
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "PopupSerializer.h"
-
-#include <memory>
-
-namespace Wrt {
-namespace PopupSerializer {
-
-void appendArg(int arg, DPL::BinaryQueue &buffer)
-{
- size_t argSize = sizeof(arg);
- buffer.AppendCopy(&argSize, sizeof(argSize));
- buffer.AppendCopy(&arg, sizeof(arg));
-}
-
-void appendArg(const std::string &arg, DPL::BinaryQueue &buffer)
-{
- size_t argSize = arg.size();
- buffer.AppendCopy(&argSize, sizeof(argSize));
- buffer.AppendCopy(arg.c_str(), argSize);
-}
-
-int getIntArg(DPL::BinaryQueue &buffer)
-{
- int result;
- size_t argSize;
- buffer.FlattenConsume(&argSize, sizeof(argSize));
- buffer.FlattenConsume(&result, argSize);
- //TODO: what if argSize != sizeof(int)
- //This should not be problem if this is run on the same machine.
- return result;
-}
-
-std::string getStringArg(DPL::BinaryQueue &buffer)
-{
- std::string::size_type size;
- buffer.FlattenConsume(&size, sizeof(size));
- std::unique_ptr<char[]> str(new char[size]);
- buffer.FlattenConsume(str.get(), size);
- return std::string(str.get(), str.get() + size);
-}
-
-}
-} // Wrt
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WRT_POPUP_SERIALIZER_H
-#define WRT_POPUP_SERIALIZER_H
-
-#include <string>
-#include <dpl/binary_queue.h>
-
-namespace Wrt {
-namespace PopupSerializer {
-
-void appendArg(int arg, DPL::BinaryQueue &buffer);
-void appendArg(const std::string &arg, DPL::BinaryQueue &buffer);
-
-int getIntArg(DPL::BinaryQueue &buffer);
-std::string getStringArg(DPL::BinaryQueue &buffer);
-
-}
-} // Wrt
-
-#endif
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file YesNoPopup.cpp
- * @author Andrzej Surdej (a.surdej@samsung.com)
- * @version 1.0
- * @brief Popup that contains 'Yes' and 'No' buttons. Inplementation
- */
-
-#include "YesNoPopup.h"
-#include <memory>
-#include <string.h>
-#include <dpl/popup/popup_manager.h>
-#include "PopupSerializer.h"
-
-namespace {
-const char YES_LABEL[] = "Yes";
-const char NO_LABEL[] = "No";
-const int POPUP_YES_VALUE = 1;
-const int POPUP_NO_VALUE = 2;
-} //anonymous
-
-namespace Wrt {
-namespace PopupProcess {
-using namespace DPL::Popup;
-
-void YesNoPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
-{
- LogDebug("Entered");
- std::string title = PopupSerializer::getStringArg(*data);
- std::string message = PopupSerializer::getStringArg(*data);
- Assert(data->Empty());
- LogDebug("title: " << title << " message: " << message);
-
- m_parent = parent;
-
- CtrlPopupPtr popup = PopupControllerSingleton::Instance().CreatePopup();
-
- popup->SetTitle(title);
- popup->Append(new PopupObject::Label(message));
-
- popup->Append(new PopupObject::Button(YES_LABEL, POPUP_YES_VALUE));
- popup->Append(new PopupObject::Button(NO_LABEL, POPUP_NO_VALUE));
-
- ListenForAnswer(popup);
-
- ShowPopupEventShort event(popup,
- MakeAnswerCallback(
- this,
- &YesNoPopup::responseCallback));
-
- CONTROLLER_POST_EVENT(PopupController,
- event);
-
- LogDebug("Exited");
- return;
-}
-
-void YesNoPopup::responseCallback(const DPL::Popup::AnswerCallbackData &answer)
-{
- bool result = (POPUP_YES_VALUE == answer.buttonAnswer);
- DPL::BinaryQueue retValue;
- PopupSerializer::appendArg(result, retValue);
- m_parent->response(retValue);
-}
-
-} // PopupProcess
-} // Wrt
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file YesNoPopup.h
- * @author Andrzej Surdej (a.surdej@samsung.com)
- * @version 1.0
- * @brief Popup that contains 'Yes' and 'No' buttons
- */
-
-#ifndef WRT_YES_NO_POPUP_H
-#define WRT_YES_NO_POPUP_H
-
-#include "wrt-popup.h"
-
-namespace Wrt {
-namespace PopupProcess {
-
-class YesNoPopup : public IPopup
-{
-public:
- virtual void show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent);
-
-private:
-
- void responseCallback(const DPL::Popup::AnswerCallbackData &answer);
- WrtPopup* m_parent;
-};
-
-} // PopupProcess
-} // Wrt
-
-#endif /* WRT_YES_NO_POPUP_H */
-
dpl-wrt-dao-ro
wrt-commons-auto-save-dao-rw
wrt-commons-security-origin-dao
+ wrt-popup-wrt-runner
REQUIRED
)
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_user_agent_support.cpp
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_vibration_support.cpp
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_web_notification_support.cpp
- ${PROJECT_SOURCE_DIR}/src/popup-process/PopupSerializer
- ${PROJECT_SOURCE_DIR}/src/popup-process/PopupInvoker.cpp
)
SET(VIEW_COMMON_INCLUDES
${PROJECT_SOURCE_DIR}/src/domain
${PROJECT_SOURCE_DIR}/src/global_logic
- ${PROJECT_SOURCE_DIR}/src/popup-process
${PROJECT_SOURCE_DIR}/src/profiling
${PROJECT_SOURCE_DIR}/src/utils
${PROJECT_SOURCE_DIR}/src/view/common
#include "view_logic_geolocation_support.h"
-#include <PopupInvoker.h>
#include <dpl/log/log.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include <popup-runner/PopupInvoker.h>
#include <view_logic_security_support.h>
namespace {
bool askUserForPermission()
{
- return Wrt::PopupInvoker().askYesNo(
+ return Wrt::Popup::PopupInvoker().askYesNo(
GEOLOCATION_ASK_TITLE,
GEOLOCATION_ASK_MSG);
}
#include "view_logic_password_support.h"
#include <string>
+#include <memory>
#include <dpl/assert.h>
#include <dpl/log/log.h>
#include <dpl/scoped_ptr.h>
#include <dpl/optional_typedefs.h>
#include <dpl/foreach.h>
#include <wrt-commons/auto-save-dao-rw/auto_save_dao.h>
+#include <popup-runner/PopupInvoker.h>
#include <Eina.h>
#include <iri.h>
-#include <PopupInvoker.h>
#include <vconf.h>
namespace ViewModule {
} else if (!strcmp(autoSaveStatus, AUTOSAVEIDPASS_ALWAYS_ASK)) {
LogDebug("AutoSaveStatus is AUTOSAVEIDPASS_ALWAYS_ASK");
// show popup
- bool answer = Wrt::PopupInvoker().askYesNo(AUTOSAVE_ASK_TITLE,
- AUTOSAVE_ASK_MSG);
+ bool answer = Wrt::Popup::PopupInvoker().askYesNo(AUTOSAVE_ASK_TITLE,
+ AUTOSAVE_ASK_MSG);
if (answer) {
LogDebug("save data");
AutoSaveDAO::setAutoSaveSubmitFormData(host, submitFormData);
PKG_CHECK_MODULES(VIEW_MODULE_DEP
dpl-dbus-efl
- dpl-popup-efl
dpl-utils-efl
dpl-wrt-dao-ro
wrt-commons-custom-handler-dao-rw
#include <EWebKit2.h>
#include <js_overlay_types.h>
#include <i_runnable_widget_object.h>
-#include <PopupInvoker.h>
#include <profiling_util.h>
namespace {
#include <wrt-commons/security-origin-dao/security_origin_dao_types.h>
#include <wrt-commons/security-origin-dao/security_origin_dao.h>
#include <EWebKit2.h>
-#include <PopupInvoker.h>
#include <common/view_logic_security_origin_support.h>
#include <Elementary.h>