diff --git a/atom/app/atom_content_client.cc b/atom/app/atom_content_client.cc index 1ba1f2031564..e760c01453d4 100644 --- a/atom/app/atom_content_client.cc +++ b/atom/app/atom_content_client.cc @@ -7,6 +7,7 @@ #include #include +#include "atom/common/atom_version.h" #include "atom/common/chrome_version.h" #include "atom/common/options_switches.h" #include "base/command_line.h" @@ -14,6 +15,7 @@ #include "base/strings/string_util.h" #include "content/public/common/content_constants.h" #include "content/public/common/pepper_plugin_info.h" +#include "content/public/common/user_agent.h" #include "ppapi/shared_impl/ppapi_permissions.h" namespace atom { @@ -72,6 +74,12 @@ std::string AtomContentClient::GetProduct() const { return "Chrome/" CHROME_VERSION_STRING; } +std::string AtomContentClient::GetUserAgent() const { + return content::BuildUserAgentFromProduct( + "Chrome/" CHROME_VERSION_STRING " " + ATOM_PRODUCT_NAME "/" ATOM_VERSION_STRING); +} + void AtomContentClient::AddAdditionalSchemes( std::vector* standard_schemes, std::vector* savable_schemes) { diff --git a/atom/app/atom_content_client.h b/atom/app/atom_content_client.h index 279ec7179f49..a6b2f73e7faa 100644 --- a/atom/app/atom_content_client.h +++ b/atom/app/atom_content_client.h @@ -20,6 +20,7 @@ class AtomContentClient : public brightray::ContentClient { protected: // content::ContentClient: std::string GetProduct() const override; + std::string GetUserAgent() const override; void AddAdditionalSchemes( std::vector* standard_schemes, std::vector* savable_schemes) override;