~a-v-shkop/chromium-browser/stable

« back to all changes in this revision

Viewing changes to debian/patches/chromium_useragent.patch.in

  • Committer: Alex Shkop
  • Date: 2013-03-31 11:14:13 UTC
  • Revision ID: a.v.shkop@gmail.com-20130331111413-p83di651z6f9gqi0
* WebApps patches
* New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: src/webkit/glue/user_agent.cc
 
1
Index: src/webkit/user_agent/user_agent_util.cc
2
2
===================================================================
3
 
--- src.orig/webkit/glue/user_agent.cc  2011-10-20 21:31:42.228492515 +0100
4
 
+++ src/webkit/glue/user_agent.cc       2011-10-20 21:36:06.260487823 +0100
5
 
@@ -130,15 +130,22 @@
 
3
--- src.orig/webkit/user_agent/user_agent_util.cc       2012-09-14 11:36:29.000000000 +0300
 
4
+++ src/webkit/user_agent/user_agent_util.cc    2012-09-14 14:33:55.224741273 +0300
 
5
@@ -166,13 +166,21 @@
 
6
   // Derived from Safari's UA string.
6
7
   // This is done to expose our product name in a manner that is maximally
7
8
   // compatible with Safari, we hope!!
8
 
 
 
9
+
9
10
+  // We want to also add Chromium
10
11
+  std::string realproduct = product.c_str();
11
12
+  size_t pos;
12
13
+  if ((pos = realproduct.find("/")) != std::string::npos)
13
14
+      realproduct.replace(0, pos, "Chromium");
14
15
+
15
 
   // Derived from Safari's UA string.
 
16
   std::string user_agent;
16
17
   base::StringAppendF(
17
18
       &user_agent,
18
 
       "Mozilla/5.0 (%s%s) AppleWebKit/%d.%d"
19
 
-      " (KHTML, like Gecko) %s Safari/%d.%d",
20
 
+      " (KHTML, like Gecko) @BUILD_DIST_NAME@/@BUILD_DIST_VERSION@ %s %s Safari/%d.%d",
21
 
       kUserAgentPlatform,
22
 
       webkit_glue::BuildOSCpuInfo().c_str(),
 
19
-      "Mozilla/5.0 (%s) AppleWebKit/%d.%d (KHTML, like Gecko) %s Safari/%d.%d",
 
20
+      "Mozilla/5.0 (%s) AppleWebKit/%d.%d (KHTML, like Gecko) @BUILD_DIST_NAME@/@BUILD_DIST_VERSION@ %s %s Safari/%d.%d",
 
21
       os_info.c_str(),
23
22
       WEBKIT_VERSION_MAJOR,
24
23
       WEBKIT_VERSION_MINOR,
25
24
+      realproduct.c_str(),