electron/brightray/common/application_info_win.cc
Adam Roben 54419bbbb1 Set the user agent string correctly on Windows
We use the main executable's ProductName and FileVersion resources to build the
user agent string.
2013-05-28 15:24:55 -04:00

19 lines
556 B
C++

#include "common/application_info.h"
#include "base/file_version_info.h"
#include "base/memory/scoped_ptr.h"
#include "base/utf_string_conversions.h"
namespace brightray {
std::string GetApplicationName() {
auto info = make_scoped_ptr(FileVersionInfo::CreateFileVersionInfoForModule(GetModuleHandle(nullptr)));
return UTF16ToUTF8(info->product_name());
}
std::string GetApplicationVersion() {
auto info = make_scoped_ptr(FileVersionInfo::CreateFileVersionInfoForModule(GetModuleHandle(nullptr)));
return UTF16ToUTF8(info->file_version());
}
}