LoggerE("WebApplication couldn't be created.");
return false;
}
+ application_->set_terminator([](){ ui_app_exit(); });
// Process First Launch
native_window_ = CreateNativeWindow();
ewk_context_(ewk_context_new()),
locale_manager_(new LocaleManager()),
app_data_(new ApplicationData(appid)),
- debug_mode_(false) {
+ debug_mode_(false),
+ terminator_(NULL) {
// app_data_path
std::unique_ptr<char, decltype(std::free)*>
path {app_get_data_path(), std::free};
ewk_context_(ewk_context_new()),
locale_manager_(new LocaleManager()),
app_data_(std::move(app_data)),
- debug_mode_(false) {
+ debug_mode_(false),
+ terminator_(NULL) {
// app_data_path
std::unique_ptr<char, decltype(std::free)*>
path {app_get_data_path(), std::free};
}
if (view_stack_.size() == 0) {
- // TODO(sngn.lee): terminate the webapp
+ if (terminator_ != NULL) {
+ terminator_();
+ }
} else if (current != view_stack_.front()) {
view_stack_.front()->SetVisibility(true);
window_->SetContent(view_stack_.front()->evas_object());
#include <string>
#include <list>
#include <memory>
+#include <functional>
#include "runtime/web_view.h"
#include "extension/extension_server.h"
bool Initialize(NativeWindow* window);
std::string data_path() const { return app_data_path_; }
bool initialized() const { return initialized_; }
+ void set_terminator(std::function<void(void)> terminator)
+ { terminator_ = terminator; }
virtual void OnCreatedNewWebView(WebView* view, WebView* new_view);
virtual void OnClosedWebView(WebView * view);
std::unique_ptr<LocaleManager> locale_manager_;
std::unique_ptr<ApplicationData> app_data_;
bool debug_mode_;
+ std::function<void(void)> terminator_;
};
} // namespace wrt