public:
explicit AppControl(app_control_h app_control);
~AppControl();
+ // disable copy
+ AppControl(const AppControl& src) = delete;
+ AppControl& operator=(const AppControl&) = delete;
std::string operation() const;
std::string mime() const;
#include <ewk_chromium.h>
#include <string>
+#include <memory>
#include "common/logger.h"
#include "runtime/command_line.h"
#include "runtime/native_app_window.h"
+#include "runtime/app_control.h"
namespace wrt {
}
void Runtime::OnAppControl(app_control_h app_control) {
+ std::unique_ptr<AppControl> appcontrol(new AppControl(app_control));
+
if (application_->initialized()) {
// Process AppControl
- application_->AppControl();
+ application_->AppControl(std::move(appcontrol));
} else {
- application_->Launch();
+ application_->Launch(std::move(appcontrol));
}
}
#include "runtime/web_view.h"
#include "runtime/vibration_manager.h"
#include "common/logger.h"
+#include "runtime/app_control.h"
namespace {
// TODO(sngn.lee) : It should be declare in common header
return true;
}
-void WebApplication::Launch() {
+void WebApplication::Launch(std::unique_ptr<wrt::AppControl> appcontrol) {
initialized_ = true;
WebView* view = new WebView(window_, ewk_context_);
view->SetEventListener(this);
window_->Show();
}
-void WebApplication::AppControl() {
+void WebApplication::AppControl(std::unique_ptr<wrt::AppControl> appcontrol) {
// TODO(sngn.lee): find the app control url and the reset options
// TODO(sngn.lee): Set the injected bundle into extension process
#include <string>
#include <list>
+#include <memory>
#include "runtime/web_view.h"
#include "runtime/locale_manager.h"
namespace wrt {
class NativeWindow;
+class AppControl;
class WebApplication : public WebView::EventListener {
public:
explicit WebApplication(const std::string& appid);
virtual ~WebApplication();
- void AppControl();
- void Launch();
+ void AppControl(std::unique_ptr<wrt::AppControl> appcontrol);
+ void Launch(std::unique_ptr<wrt::AppControl> appcontrol);
void Resume();
void Suspend();