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

View file

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

View file

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