Merge pull request #2175 from atom/propagate-app-model-id
Propagate App Model User ID on Windows
This commit is contained in:
commit
0c7c6ddcc9
4 changed files with 34 additions and 0 deletions
|
@ -8,6 +8,10 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#if defined(OS_WIN)
|
||||||
|
#include <shlobj.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "atom/browser/atom_browser_context.h"
|
#include "atom/browser/atom_browser_context.h"
|
||||||
#include "atom/browser/atom_browser_main_parts.h"
|
#include "atom/browser/atom_browser_main_parts.h"
|
||||||
#include "atom/browser/browser.h"
|
#include "atom/browser/browser.h"
|
||||||
|
@ -388,6 +392,16 @@ void NativeWindow::AppendExtraCommandLineSwitches(
|
||||||
command_line->AppendSwitchASCII(switches::kZoomFactor,
|
command_line->AppendSwitchASCII(switches::kZoomFactor,
|
||||||
base::DoubleToString(zoom_factor_));
|
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())
|
if (web_preferences_.IsEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,9 @@ const char kDisableHttpCache[] = "disable-http-cache";
|
||||||
// Register schemes to standard.
|
// Register schemes to standard.
|
||||||
const char kRegisterStandardSchemes[] = "register-standard-schemes";
|
const char kRegisterStandardSchemes[] = "register-standard-schemes";
|
||||||
|
|
||||||
|
// The browser process app model ID
|
||||||
|
const char kAppUserModelId[] = "app-user-model-id";
|
||||||
|
|
||||||
} // namespace switches
|
} // namespace switches
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -58,6 +58,8 @@ extern const char kPageVisibility[];
|
||||||
extern const char kDisableHttpCache[];
|
extern const char kDisableHttpCache[];
|
||||||
extern const char kRegisterStandardSchemes[];
|
extern const char kRegisterStandardSchemes[];
|
||||||
|
|
||||||
|
extern const char kAppUserModelId[];
|
||||||
|
|
||||||
} // namespace switches
|
} // namespace switches
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -27,6 +27,10 @@
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
|
|
||||||
|
#if defined(OS_WIN)
|
||||||
|
#include <shlobj.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -87,6 +91,17 @@ void AtomRendererClient::WebKitInitialized() {
|
||||||
blink::WebCustomElement::addEmbedderCustomElementName("webview");
|
blink::WebCustomElement::addEmbedderCustomElementName("webview");
|
||||||
blink::WebCustomElement::addEmbedderCustomElementName("browserplugin");
|
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_->Initialize();
|
||||||
node_bindings_->PrepareMessageLoop();
|
node_bindings_->PrepareMessageLoop();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue