Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / process_singleton_win.cc
index 66a8180..f683ea8 100644 (file)
@@ -20,7 +20,6 @@
 #include "base/win/metro.h"
 #include "base/win/registry.h"
 #include "base/win/scoped_handle.h"
-#include "base/win/win_util.h"
 #include "base/win/windows_version.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/browser_process_platform_part.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/chrome_paths_internal.h"
 #include "chrome/common/chrome_switches.h"
+#include "chrome/grit/chromium_strings.h"
 #include "chrome/installer/util/wmi.h"
 #include "content/public/common/result_codes.h"
-#include "grit/chromium_strings.h"
-#include "grit/generated_resources.h"
 #include "net/base/escape.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/gfx/win/hwnd_util.h"
@@ -196,8 +194,7 @@ bool ShouldLaunchInWindows8ImmersiveMode(const base::FilePath& user_data_dir) {
   // to relaunch desktop launched chrome into immersive mode through 'relaunch'
   // menu. In case of Aura, we will use delegate_execute to do the relaunch.
   return false;
-#endif
-
+#else
   if (base::win::GetVersion() < base::win::VERSION_WIN8)
     return false;
 
@@ -228,7 +225,8 @@ bool ShouldLaunchInWindows8ImmersiveMode(const base::FilePath& user_data_dir) {
                           &reg_value) == ERROR_SUCCESS) {
     return reg_value == 1;
   }
-  return base::win::IsTouchEnabledDevice();
+  return false;
+#endif
 }
 
 }  // namespace
@@ -358,9 +356,12 @@ bool ProcessSingleton::Create() {
     // since it isn't guaranteed we will get it. It is better to create it
     // without ownership and explicitly get the ownership afterward.
     base::win::ScopedHandle only_me(::CreateMutex(NULL, FALSE, kMutexName));
-    DPCHECK(only_me.IsValid());
+    if (!only_me.IsValid()) {
+      DPLOG(FATAL) << "CreateMutex failed";
+      return false;
+    }
 
-    AutoLockMutex auto_lock_only_me(only_me);
+    AutoLockMutex auto_lock_only_me(only_me.Get());
 
     // We now own the mutex so we are the only process that can create the
     // window at this time, but we must still check if someone created it
@@ -404,9 +405,9 @@ bool ProcessSingleton::Create() {
         // until the event is signaled (i.e. Metro Chrome was successfully
         // activated). Ignore timeout waiting for |metro_activation_event|.
         {
-          AutoUnlockMutex auto_unlock_only_me(only_me);
+          AutoUnlockMutex auto_unlock_only_me(only_me.Get());
 
-          DWORD result = ::WaitForSingleObject(metro_activation_event,
+          DWORD result = ::WaitForSingleObject(metro_activation_event.Get(),
                                                kMetroChromeActivationTimeoutMs);
           DPCHECK(result == WAIT_OBJECT_0 || result == WAIT_TIMEOUT)
               << "Result = " << result;
@@ -452,7 +453,7 @@ bool ProcessSingleton::Create() {
         base::win::ScopedHandle metro_activation_event(
             ::OpenEvent(EVENT_MODIFY_STATE, FALSE, kMetroActivationEventName));
         if (metro_activation_event.IsValid())
-          ::SetEvent(metro_activation_event);
+          ::SetEvent(metro_activation_event.Get());
       }
     }
   }