From 54419bbbb1a46a0aaa8dc71c9ac85da4f0896637 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 28 May 2013 15:24:55 -0400 Subject: [PATCH] Set the user agent string correctly on Windows We use the main executable's ProductName and FileVersion resources to build the user agent string. --- brightray/common/application_info_win.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/brightray/common/application_info_win.cc b/brightray/common/application_info_win.cc index 113330158608..c099db02f403 100644 --- a/brightray/common/application_info_win.cc +++ b/brightray/common/application_info_win.cc @@ -1,13 +1,19 @@ #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() { - return std::string(); + auto info = make_scoped_ptr(FileVersionInfo::CreateFileVersionInfoForModule(GetModuleHandle(nullptr))); + return UTF16ToUTF8(info->product_name()); } std::string GetApplicationVersion() { - return std::string(); + auto info = make_scoped_ptr(FileVersionInfo::CreateFileVersionInfoForModule(GetModuleHandle(nullptr))); + return UTF16ToUTF8(info->file_version()); } }