]> khamidou — GitHub mirrors - electron.git/commitdiff
Set AppUserModelID for all renderer processes
authorCheng Zhao <zcbenz@gmail.com>
Tue, 4 Aug 2015 09:13:05 +0000 (17:13 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 4 Aug 2015 09:13:05 +0000 (17:13 +0800)
atom/browser/atom_browser_client.cc
atom/browser/native_window.cc

index f98f2b2a887370e2cde124bc0836fd6be80f70e2..65fd7cd031dd50f765a2ed1325faa9d05586a2ca 100644 (file)
@@ -4,6 +4,10 @@
 
 #include "atom/browser/atom_browser_client.h"
 
+#if defined(OS_WIN)
+#include <shlobj.h>
+#endif
+
 #include "atom/browser/atom_access_token_store.h"
 #include "atom/browser/atom_browser_context.h"
 #include "atom/browser/atom_browser_main_parts.h"
@@ -190,10 +194,20 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
   if (process_type != "renderer")
     return;
 
+  // The registered standard schemes.
   if (!g_custom_schemes.empty())
     command_line->AppendSwitchASCII(switches::kRegisterStandardSchemes,
                                     g_custom_schemes);
 
+#if defined(OS_WIN)
+  // Append --app-user-model-id.
+  PWSTR current_app_id;
+  if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(&current_app_id))) {
+    command_line->AppendSwitchNative(switches::kAppUserModelId, current_app_id);
+    CoTaskMemFree(current_app_id);
+  }
+#endif
+
   NativeWindow* window;
   WebViewManager::WebViewInfo info;
   ProcessOwner owner = GetProcessOwner(process_id, &window, &info);
index fb9bab766dd8810b14cafc63daaccb95ec903cd0..d3c40f92827263c1e08e4cbc4c198053714d56d2 100644 (file)
@@ -8,10 +8,6 @@
 #include <utility>
 #include <vector>
 
-#if defined(OS_WIN)
-#include <shlobj.h>
-#endif
-
 #include "atom/browser/atom_browser_context.h"
 #include "atom/browser/atom_browser_main_parts.h"
 #include "atom/browser/window_list.h"
@@ -384,15 +380,6 @@ void NativeWindow::AppendExtraCommandLineSwitches(
     command_line->AppendSwitchASCII(switches::kZoomFactor,
                                     base::DoubleToString(zoom_factor_));
 
-#if defined(OS_WIN)
-  // Append --app-user-model-id.
-  PWSTR current_app_id;
-  if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(&current_app_id))) {
-    command_line->AppendSwitchNative(switches::kAppUserModelId, current_app_id);
-    CoTaskMemFree(current_app_id);
-  }
-#endif
-
   if (web_preferences_.IsEmpty())
     return;