Browse Source

Pretend to be Chrome by default.

This is used to cheat client web drivers.
Cheng Zhao 10 years ago
parent
commit
925ff2da5b
2 changed files with 7 additions and 0 deletions
  1. 6 0
      atom/app/atom_content_client.cc
  2. 1 0
      atom/app/atom_content_client.h

+ 6 - 0
atom/app/atom_content_client.cc

@@ -7,6 +7,8 @@
 #include <string>
 #include <vector>
 
+#include "atom/common/chrome_version.h"
+
 namespace atom {
 
 AtomContentClient::AtomContentClient() {
@@ -15,6 +17,10 @@ AtomContentClient::AtomContentClient() {
 AtomContentClient::~AtomContentClient() {
 }
 
+std::string AtomContentClient::GetProduct() const {
+  return "Chrome/" CHROME_VERSION_STRING;
+}
+
 void AtomContentClient::AddAdditionalSchemes(
     std::vector<std::string>* standard_schemes,
     std::vector<std::string>* savable_schemes) {

+ 1 - 0
atom/app/atom_content_client.h

@@ -19,6 +19,7 @@ class AtomContentClient : public brightray::ContentClient {
 
  protected:
   // content::ContentClient:
+  virtual std::string GetProduct() const OVERRIDE;
   virtual void AddAdditionalSchemes(
       std::vector<std::string>* standard_schemes,
       std::vector<std::string>* savable_schemes) OVERRIDE;