Fix #3297.
Fix #2573.
#include <string>
#include <vector>
-#if defined(OS_WIN)
-#include <shlobj.h>
-#endif
-
#include "atom/browser/api/atom_api_menu.h"
#include "atom/browser/api/atom_api_session.h"
#include "atom/browser/api/atom_api_web_contents.h"
#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) {
auto browser_context = static_cast<AtomBrowserContext*>(
AtomBrowserMainParts::Get()->browser_context());
base::Bind(&Browser::AddRecentDocument, browser))
.SetMethod("clearRecentDocuments",
base::Bind(&Browser::ClearRecentDocuments, browser))
+ .SetMethod("setAppUserModelId",
+ base::Bind(&Browser::SetAppUserModelID, browser))
#if defined(OS_WIN)
.SetMethod("setUserTasks",
base::Bind(&Browser::SetUserTasks, browser))
.SetMethod("setPath", &App::SetPath)
.SetMethod("getPath", &App::GetPath)
.SetMethod("setDesktopName", &App::SetDesktopName)
- .SetMethod("setAppUserModelId", &App::SetAppUserModelId)
.SetMethod("allowNTLMCredentialsForAllDomains",
&App::AllowNTLMCredentialsForAllDomains)
.SetMethod("getLocale", &App::GetLocale)
const base::FilePath& path);
void SetDesktopName(const std::string& desktop_name);
- void SetAppUserModelId(const std::string& app_id);
void AllowNTLMCredentialsForAllDomains(bool should_allow);
bool MakeSingleInstance(
const ProcessSingleton::NotificationCallback& callback);
// Clear the recent documents list.
void ClearRecentDocuments();
+ // Set the application user model ID.
+ void SetAppUserModelID(const base::string16& name);
+
#if defined(OS_MACOSX)
// Bounce the dock icon.
enum BounceType {
// Add a custom task to jump list.
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
// one from app's name.
// The returned string managed by Browser, and should not be modified.
void Browser::ClearRecentDocuments() {
}
+void Browser::SetAppUserModelID(const base::string16& name) {
+}
+
std::string Browser::GetExecutableFileVersion() const {
return brightray::GetApplicationVersion();
}
void Browser::ClearRecentDocuments() {
}
+void Browser::SetAppUserModelID(const base::string16& name) {
+}
+
std::string Browser::GetExecutableFileVersion() const {
return brightray::GetApplicationVersion();
}
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) {
CComPtr<ICustomDestinationList> destinations;
if (FAILED(destinations.CoCreateInstance(CLSID_DestinationList)))
destinations->CommitList();
}
-void Browser::SetAppUserModelID(const base::string16& name) {
- app_user_model_id_ = name;
- SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
-}
-
PCWSTR Browser::GetAppUserModelID() {
if (app_user_model_id_.empty())
SetAppUserModelID(base::UTF8ToUTF16(GetName()));