Create an explicit API for setting the App User Model ID
This commit is contained in:
parent
d826e1e5fb
commit
fb6c80d12e
2 changed files with 9 additions and 0 deletions
|
@ -200,6 +200,13 @@ void App::SetDesktopName(const std::string& desktop_name) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void App::SetAppUserModelId(const std::string& app_id) {
|
||||||
|
#if defined(OS_WIN)
|
||||||
|
base::string16 app_id_utf16 = base::UTF8ToUTF16(app_id);
|
||||||
|
SetCurrentProcessExplicitAppUserModelID(app_id_utf16.c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
||||||
v8::Isolate* isolate) {
|
v8::Isolate* isolate) {
|
||||||
auto browser = base::Unretained(Browser::Get());
|
auto browser = base::Unretained(Browser::Get());
|
||||||
|
@ -223,6 +230,7 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
||||||
.SetMethod("getPath", &App::GetPath)
|
.SetMethod("getPath", &App::GetPath)
|
||||||
.SetMethod("resolveProxy", &App::ResolveProxy)
|
.SetMethod("resolveProxy", &App::ResolveProxy)
|
||||||
.SetMethod("setDesktopName", &App::SetDesktopName);
|
.SetMethod("setDesktopName", &App::SetDesktopName);
|
||||||
|
.SetMethod("setAppUserModelId", &App::SetAppUserModelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -61,6 +61,7 @@ class App : public mate::EventEmitter,
|
||||||
|
|
||||||
void ResolveProxy(const GURL& url, ResolveProxyCallback callback);
|
void ResolveProxy(const GURL& url, ResolveProxyCallback callback);
|
||||||
void SetDesktopName(const std::string& desktop_name);
|
void SetDesktopName(const std::string& desktop_name);
|
||||||
|
void SetAppUserModelId(const std::string& app_id);
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(App);
|
DISALLOW_COPY_AND_ASSIGN(App);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue