parent
7c7a7b96de
commit
9047f81835
6 changed files with 16 additions and 21 deletions
|
@ -7,10 +7,6 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
#include <shlobj.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "atom/browser/api/atom_api_menu.h"
|
#include "atom/browser/api/atom_api_menu.h"
|
||||||
#include "atom/browser/api/atom_api_session.h"
|
#include "atom/browser/api/atom_api_session.h"
|
||||||
#include "atom/browser/api/atom_api_web_contents.h"
|
#include "atom/browser/api/atom_api_web_contents.h"
|
||||||
|
@ -299,13 +295,6 @@ 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
|
|
||||||
}
|
|
||||||
|
|
||||||
void App::AllowNTLMCredentialsForAllDomains(bool should_allow) {
|
void App::AllowNTLMCredentialsForAllDomains(bool should_allow) {
|
||||||
auto browser_context = static_cast<AtomBrowserContext*>(
|
auto browser_context = static_cast<AtomBrowserContext*>(
|
||||||
AtomBrowserMainParts::Get()->browser_context());
|
AtomBrowserMainParts::Get()->browser_context());
|
||||||
|
@ -360,6 +349,8 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
||||||
base::Bind(&Browser::AddRecentDocument, browser))
|
base::Bind(&Browser::AddRecentDocument, browser))
|
||||||
.SetMethod("clearRecentDocuments",
|
.SetMethod("clearRecentDocuments",
|
||||||
base::Bind(&Browser::ClearRecentDocuments, browser))
|
base::Bind(&Browser::ClearRecentDocuments, browser))
|
||||||
|
.SetMethod("setAppUserModelId",
|
||||||
|
base::Bind(&Browser::SetAppUserModelID, browser))
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
.SetMethod("setUserTasks",
|
.SetMethod("setUserTasks",
|
||||||
base::Bind(&Browser::SetUserTasks, browser))
|
base::Bind(&Browser::SetUserTasks, browser))
|
||||||
|
@ -367,7 +358,6 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
||||||
.SetMethod("setPath", &App::SetPath)
|
.SetMethod("setPath", &App::SetPath)
|
||||||
.SetMethod("getPath", &App::GetPath)
|
.SetMethod("getPath", &App::GetPath)
|
||||||
.SetMethod("setDesktopName", &App::SetDesktopName)
|
.SetMethod("setDesktopName", &App::SetDesktopName)
|
||||||
.SetMethod("setAppUserModelId", &App::SetAppUserModelId)
|
|
||||||
.SetMethod("allowNTLMCredentialsForAllDomains",
|
.SetMethod("allowNTLMCredentialsForAllDomains",
|
||||||
&App::AllowNTLMCredentialsForAllDomains)
|
&App::AllowNTLMCredentialsForAllDomains)
|
||||||
.SetMethod("getLocale", &App::GetLocale)
|
.SetMethod("getLocale", &App::GetLocale)
|
||||||
|
|
|
@ -67,7 +67,6 @@ class App : public mate::EventEmitter,
|
||||||
const base::FilePath& path);
|
const base::FilePath& path);
|
||||||
|
|
||||||
void SetDesktopName(const std::string& desktop_name);
|
void SetDesktopName(const std::string& desktop_name);
|
||||||
void SetAppUserModelId(const std::string& app_id);
|
|
||||||
void AllowNTLMCredentialsForAllDomains(bool should_allow);
|
void AllowNTLMCredentialsForAllDomains(bool should_allow);
|
||||||
bool MakeSingleInstance(
|
bool MakeSingleInstance(
|
||||||
const ProcessSingleton::NotificationCallback& callback);
|
const ProcessSingleton::NotificationCallback& callback);
|
||||||
|
|
|
@ -66,6 +66,9 @@ class Browser : public WindowListObserver {
|
||||||
// Clear the recent documents list.
|
// Clear the recent documents list.
|
||||||
void ClearRecentDocuments();
|
void ClearRecentDocuments();
|
||||||
|
|
||||||
|
// Set the application user model ID.
|
||||||
|
void SetAppUserModelID(const base::string16& name);
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
// Bounce the dock icon.
|
// Bounce the dock icon.
|
||||||
enum BounceType {
|
enum BounceType {
|
||||||
|
@ -100,9 +103,6 @@ class Browser : public WindowListObserver {
|
||||||
// Add a custom task to jump list.
|
// Add a custom task to jump list.
|
||||||
void SetUserTasks(const std::vector<UserTask>& tasks);
|
void SetUserTasks(const std::vector<UserTask>& tasks);
|
||||||
|
|
||||||
// Set the application user model ID.
|
|
||||||
void SetAppUserModelID(const base::string16& name);
|
|
||||||
|
|
||||||
// Returns the application user model ID, if there isn't one, then create
|
// Returns the application user model ID, if there isn't one, then create
|
||||||
// one from app's name.
|
// one from app's name.
|
||||||
// The returned string managed by Browser, and should not be modified.
|
// The returned string managed by Browser, and should not be modified.
|
||||||
|
|
|
@ -31,6 +31,9 @@ void Browser::AddRecentDocument(const base::FilePath& path) {
|
||||||
void Browser::ClearRecentDocuments() {
|
void Browser::ClearRecentDocuments() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Browser::SetAppUserModelID(const base::string16& name) {
|
||||||
|
}
|
||||||
|
|
||||||
std::string Browser::GetExecutableFileVersion() const {
|
std::string Browser::GetExecutableFileVersion() const {
|
||||||
return brightray::GetApplicationVersion();
|
return brightray::GetApplicationVersion();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,9 @@ void Browser::AddRecentDocument(const base::FilePath& path) {
|
||||||
void Browser::ClearRecentDocuments() {
|
void Browser::ClearRecentDocuments() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Browser::SetAppUserModelID(const base::string16& name) {
|
||||||
|
}
|
||||||
|
|
||||||
std::string Browser::GetExecutableFileVersion() const {
|
std::string Browser::GetExecutableFileVersion() const {
|
||||||
return brightray::GetApplicationVersion();
|
return brightray::GetApplicationVersion();
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,11 @@ void Browser::ClearRecentDocuments() {
|
||||||
destinations->RemoveAllDestinations();
|
destinations->RemoveAllDestinations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Browser::SetAppUserModelID(const base::string16& name) {
|
||||||
|
app_user_model_id_ = name;
|
||||||
|
SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
void Browser::SetUserTasks(const std::vector<UserTask>& tasks) {
|
void Browser::SetUserTasks(const std::vector<UserTask>& tasks) {
|
||||||
CComPtr<ICustomDestinationList> destinations;
|
CComPtr<ICustomDestinationList> destinations;
|
||||||
if (FAILED(destinations.CoCreateInstance(CLSID_DestinationList)))
|
if (FAILED(destinations.CoCreateInstance(CLSID_DestinationList)))
|
||||||
|
@ -117,11 +122,6 @@ void Browser::SetUserTasks(const std::vector<UserTask>& tasks) {
|
||||||
destinations->CommitList();
|
destinations->CommitList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::SetAppUserModelID(const base::string16& name) {
|
|
||||||
app_user_model_id_ = name;
|
|
||||||
SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
PCWSTR Browser::GetAppUserModelID() {
|
PCWSTR Browser::GetAppUserModelID() {
|
||||||
if (app_user_model_id_.empty())
|
if (app_user_model_id_.empty())
|
||||||
SetAppUserModelID(base::UTF8ToUTF16(GetName()));
|
SetAppUserModelID(base::UTF8ToUTF16(GetName()));
|
||||||
|
|
Loading…
Reference in a new issue