]> khamidou — GitHub mirrors - electron.git/commitdiff
Set the AppUserModelId on the renderer side
authorPaul Betts <paul@paulbetts.org>
Thu, 9 Jul 2015 23:48:02 +0000 (16:48 -0700)
committerPaul Betts <paul@paulbetts.org>
Thu, 9 Jul 2015 23:48:02 +0000 (16:48 -0700)
atom/renderer/atom_renderer_client.cc

index e2a114af01411f5869c9ff0724a00253768c8065..c052039173087b7f7051ce64eb89a72e0210bed7 100644 (file)
 
 #include "atom/common/node_includes.h"
 
+#if defined(OS_WIN)
+#include <shlobj.h>
+#endif
+
 namespace atom {
 
 namespace {
@@ -87,6 +91,15 @@ void AtomRendererClient::WebKitInitialized() {
   blink::WebCustomElement::addEmbedderCustomElementName("webview");
   blink::WebCustomElement::addEmbedderCustomElementName("browserplugin");
 
+#if defined(OS_WIN)
+  base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+  base::string16 explicit_app_id = command_line->GetSwitchValueNative(switches::kAppUserModelId);
+
+  if (explicit_app_id.length() > 0) {
+    SetCurrentProcessExplicitAppUserModelID(explicit_app_id.c_str());
+  }
+#endif
+
   node_bindings_->Initialize();
   node_bindings_->PrepareMessageLoop();