]> khamidou — GitHub mirrors - electron.git/commitdiff
Append the app user model ID as a switch
authorPaul Betts <paul@paulbetts.org>
Thu, 9 Jul 2015 22:57:52 +0000 (15:57 -0700)
committerPaul Betts <paul@paulbetts.org>
Thu, 9 Jul 2015 23:37:12 +0000 (16:37 -0700)
atom/browser/native_window.cc

index a1c839679c08fe956b680d95567166053489e72a..031366e1df5ce0dfb2c1d52ecd9c65e932c0925d 100644 (file)
@@ -50,6 +50,7 @@
 
 #if defined(OS_WIN)
 #include "ui/gfx/switches.h"
+#include <shlobj.h>
 #endif
 
 using content::NavigationEntry;
@@ -388,6 +389,16 @@ void NativeWindow::AppendExtraCommandLineSwitches(
     command_line->AppendSwitchASCII(switches::kZoomFactor,
                                     base::DoubleToString(zoom_factor_));
 
+#if defined(OS_WIN)
+  PWSTR explicit_app_id;
+
+  if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(&explicit_app_id))) {
+    base::string16 appId = base::string16(explicit_app_id);
+    command_line->AppendSwitchNative(switches::kAppUserModelId, appId);
+    CoTaskMemFree(explicit_app_id);
+  }
+#endif
+
   if (web_preferences_.IsEmpty())
     return;