Fix build and ensure no breaking change

This commit is contained in:
Samuel Attard 2017-12-06 07:58:48 +11:00 committed by Cheng Zhao
parent 1c43768104
commit 9676c0a4f9
3 changed files with 9 additions and 21 deletions

View file

@ -11,11 +11,7 @@
#include <shlobj.h>
#include <vector>
<<<<<<< HEAD
#include "atom/browser/browser.h"
#include "base/environment.h"
=======
>>>>>>> Fix build and ensure no breaking change
#include "base/strings/utf_string_conversions.h"
#include "brightray/browser/notification_delegate.h"
#include "brightray/browser/win/notification_presenter_win.h"
@ -33,22 +29,14 @@ using ABI::Windows::Data::Xml::Dom::IXmlText;
namespace brightray {
<<<<<<< HEAD
namespace {
bool GetAppUserModelId(ScopedHString* app_id) {
app_id->Reset(atom::api::Browser::Get()->GetAppUserModelID());
return app_id->success();
}
bool IsDebuggingNotifications() {
return base::Environment::Create()->HasVar("ELECTRON_DEBUG_NOTIFICATIONS");
}
} // namespace
=======
>>>>>>> Fix build and ensure no breaking change
// static
ComPtr<ABI::Windows::UI::Notifications::IToastNotificationManagerStatics>
WindowsToastNotification::toast_manager_;

View file

@ -4,15 +4,15 @@ namespace brightray {
namespace {
std::string g_overriden_application_name;
std::string overriden_application_name_;
}
void OverrideApplicationName(const std::string& name) {
g_overriden_application_name = name;
overriden_application_name_ = name;
}
std::string GetOverridenApplicationName() {
return g_overriden_application_name;
return overriden_application_name_;
}
} // namespace brightray

View file

@ -16,7 +16,7 @@ namespace brightray {
namespace {
base::string16 g_app_user_model_id;
base::string16 app_user_model_id_;
}
@ -37,15 +37,15 @@ std::string GetApplicationVersion() {
}
void SetAppUserModelID(const base::string16& name) {
g_app_user_model_id = name;
SetCurrentProcessExplicitAppUserModelID(g_app_user_model_id.c_str());
app_user_model_id_ = name;
SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
}
PCWSTR GetRawAppUserModelID() {
if (g_app_user_model_id.empty()) {
if (app_user_model_id_.empty()) {
PWSTR current_app_id;
if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(&current_app_id))) {
g_app_user_model_id = current_app_id;
app_user_model_id_ = current_app_id;
} else {
std::string name = GetOverridenApplicationName();
if (name.empty()) {
@ -58,7 +58,7 @@ PCWSTR GetRawAppUserModelID() {
CoTaskMemFree(current_app_id);
}
return g_app_user_model_id.c_str();
return app_user_model_id_.c_str();
}
bool GetAppUserModelID(ScopedHString* app_id) {