Run Tizen Webapps in single process mode
[platform/framework/web/crosswalk-tizen.git] / atom / browser / api / atom_api_window.cc
index f19fbda..d4a975b 100644 (file)
@@ -23,6 +23,7 @@
 #include "content/public/common/content_switches.h"
 #include "native_mate/constructor.h"
 #include "native_mate/dictionary.h"
+#include "tizen/common/env_variables.h"
 #include "ui/gfx/geometry/rect.h"
 
 #if defined(TOOLKIT_VIEWS)
@@ -163,7 +164,8 @@ void Window::WillCloseWindow(bool* prevent_default) {
 
 void Window::WillDestroyNativeObject() {
   // Close all child windows before closing current window.
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
   for (v8::Local<v8::Value> value : child_windows_.Values(isolate())) {
     mate::Handle<Window> child;
@@ -310,7 +312,7 @@ void Window::OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) {
 }
 #endif
 
-#if defined(USE_EFL)
+#if defined(OS_TIZEN)
 void Window::OnSuspend() {
   Emit("app-on-suspend");
 }
@@ -318,6 +320,10 @@ void Window::OnSuspend() {
 void Window::OnResume() {
   Emit("app-on-resume");
 }
+
+void Window::OnAppControl() {
+  Emit("app-on-appcontrol");
+}
 #endif
 
 // static