auto appdata_manager = common::ApplicationDataManager::GetInstance();
common::ApplicationData* app_data = appdata_manager->GetApplicationData(appid);
// TODO: Use resource-manager's GetStartResource() for localized urls
- std::string app_path = "file://" + app_data->application_path() + app_data->content_info()->src();
- return app_path;
+ // atom::Browser *browser_model = atom::Browser::Get();
+ // std::unique_ptr<common::ResourceManager::Resource> res = browser_model->resource_manager_->GetStartResource(appcontrol.get());
+ if (app_data) {
+ std::string app_path = "file://" + app_data->application_path();
+ if (app_data->content_info())
+ app_path += app_data->content_info()->src();
+ else
+ app_path += "index.html";
+ return app_path;
+ }
}
return "";
}
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_browser_main_parts.h"
+#include "atom/browser/browser.h"
#include "atom/browser/lib/bluetooth_chooser.h"
#include "atom/browser/native_window.h"
#include "atom/browser/net/atom_network_delegate.h"
void WebContents::CloseContents(content::WebContents* source) {
Emit("close");
-
+ LOG(ERROR) << __FUNCTION__;
if ((type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) && owner_window())
owner_window()->CloseContents(source);
}
void WebContents::HandleWrtPluginMessage(Ewk_Wrt_Message_Data* msg) {
Eina_Stringshare* msg_type = ewk_ipc_wrt_message_data_type_get(msg);
-
+ LOG(INFO) << msg_type;
#define TYPE_BEGIN(x) (!strncmp(msg_type, x, strlen(x)))
#define TYPE_IS(x) (!strcmp(msg_type, x))
-
if (TYPE_BEGIN("xwalk://")) {
auto extension_server = extensions::XWalkExtensionServer::GetInstance();
extension_server->HandleIPCMessage(msg);
} else {
- // implement in future
+ Eina_Stringshare* msg_id = msg->GetId();
+ Eina_Stringshare* msg_ref_id = msg->GetReferenceId();
+ Eina_Stringshare* msg_value = msg->GetValue();
+ if (TYPE_IS("tizen://exit")) {
+ atom::Browser *browser_model = atom::Browser::Get();
+ browser_model->Shutdown();
+ }
+
+ eina_stringshare_del(msg_ref_id);
+ eina_stringshare_del(msg_id);
+ eina_stringshare_del(msg_value);
}
+#undef TYPE_IS
+#undef TYPE_BEGIN
+
+ eina_stringshare_del(msg_type);
}
bool WebContents::OnMessageReceived(const IPC::Message& message) {
}
void WebContents::Stop() {
+ LOG(ERROR) << __FUNCTION__;
web_contents()->Stop();
}
std::string appid = runtime_cmd->GetAppIdFromCommandLine("/usr/bin/electron");
auto appdata_manager = common::ApplicationDataManager::GetInstance();
common::ApplicationData* app_data = appdata_manager->GetApplicationData(appid);
- if (!strcmp(app_data->content_info()->src().c_str(), "package.json")) {
+ if (app_data->content_info() && !strcmp(app_data->content_info()->src().c_str(), "package.json")) {
is_electron_launch_ = true;
}
} else {
void AtomRendererClient::DidCreateScriptContext(
v8::Handle<v8::Context> context, content::RenderFrame* render_frame) {
+ // Tizen device API is required both for main frame and iFrames
+#if defined(USE_EFL)
+ if (widget_) {
+ const content::RenderView* render_view = render_frame->GetRenderView();
+ widget_->StartSession(context, render_view->GetRoutingID(),
+ render_frame->GetWebFrame()->document().baseURL().string().utf8().c_str());
+ }
+#endif
// Only allow node integration for the main frame, unless it is a devtools
// extension page.
if (!render_frame->IsMainFrame() && !IsDevToolsExtension(render_frame))
// Give the node loop a run to make sure everything is ready.
node_bindings_->RunMessageLoop();
}
-#if defined(USE_EFL)
- if (widget_) {
- const content::RenderView* render_view = render_frame->GetRenderView();
- widget_->StartSession(context, render_view->GetRoutingID(),
- render_frame->GetWebFrame()->document().baseURL().string().utf8().c_str());
- }
-#endif
}
void AtomRendererClient::WillReleaseScriptContext(
v8::Handle<v8::Context> context, content::RenderFrame* render_frame) {
+ // Required both for main/sub and iframe
+#if defined(USE_EFL)
+ if (widget_)
+ widget_->StopSession(context);
+#endif
// Only allow node integration for the main frame, unless it is a devtools
// extension page.
if (!render_frame->IsMainFrame() && !IsDevToolsExtension(render_frame))
// Destroy the node environment.
node::FreeEnvironment(env);
atom_bindings_->EnvironmentDestroyed(env);
-#if defined(USE_EFL)
- if (widget_)
- widget_->StopSession(context);
-#endif
}
bool AtomRendererClient::ShouldFork(blink::WebLocalFrame* frame,
return {
fullscreen: false,
show: false,
+ webPreferences: {
+ nodeIntegration: false,
+ nodeIntegrationInWorker: false
+ },
'web-preferences': {
'direct-write': true,
'subpixel-font-scaling': false,