summaryrefslogtreecommitdiffstats
path: root/chromecast
diff options
context:
space:
mode:
authorgunsch@chromium.org <gunsch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-31 16:43:19 +0000
committergunsch@chromium.org <gunsch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-31 16:43:19 +0000
commitd345593ff7f27a576526d2cbeb4de6e4c0cb974f (patch)
treeb6da7402ed0edb618e3892b7fafc4d2acc1cbc39 /chromecast
parentf9c8c7c73e3106e8f65bb58d45c8114f4c70b590 (diff)
downloadchromium_src-d345593ff7f27a576526d2cbeb4de6e4c0cb974f.zip
chromium_src-d345593ff7f27a576526d2cbeb4de6e4c0cb974f.tar.gz
chromium_src-d345593ff7f27a576526d2cbeb4de6e4c0cb974f.tar.bz2
Generates Chromecast User-Agent string from current Chromium version.
R=mad@chromium.org,lcwu@chromium.org BUG=391080 Review URL: https://codereview.chromium.org/405073002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromecast')
-rw-r--r--chromecast/chromecast.gyp33
-rw-r--r--chromecast/common/version.h.in12
-rw-r--r--chromecast/shell/common/cast_content_client.cc7
3 files changed, 47 insertions, 5 deletions
diff --git a/chromecast/chromecast.gyp b/chromecast/chromecast.gyp
index 505bd94..cfdac1c 100644
--- a/chromecast/chromecast.gyp
+++ b/chromecast/chromecast.gyp
@@ -106,6 +106,7 @@
'cast_common',
'cast_service',
'cast_shell_pak',
+ 'cast_version_header',
'../ui/aura/aura.gyp:aura_test_support',
'../content/content.gyp:content',
'../content/content.gyp:content_app_browser',
@@ -148,5 +149,37 @@
}],
],
},
+ {
+ 'target_name': 'cast_version_header',
+ 'type': 'none',
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '<(SHARED_INTERMEDIATE_DIR)',
+ ],
+ },
+ 'actions': [
+ {
+ 'action_name': 'version_header',
+ 'message': 'Generating version header file: <@(_outputs)',
+ 'inputs': [
+ '<(version_path)',
+ 'common/version.h.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/chromecast/common/version.h',
+ ],
+ 'action': [
+ 'python',
+ '<(version_py_path)',
+ '-e', 'VERSION_FULL="<(version_full)"',
+ 'common/version.h.in',
+ '<@(_outputs)',
+ ],
+ 'includes': [
+ '../build/util/version.gypi',
+ ],
+ },
+ ],
+ },
], # end of targets
}
diff --git a/chromecast/common/version.h.in b/chromecast/common/version.h.in
new file mode 100644
index 0000000..38bc38b
--- /dev/null
+++ b/chromecast/common/version.h.in
@@ -0,0 +1,12 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// version.h is generated from version.h.in. Edit the source!
+
+#ifndef CHROMECAST_COMMON_VERSION_INFO_H_
+#define CHROMECAST_COMMON_VERSION_INFO_H_
+
+#define PRODUCT_VERSION "@VERSION_FULL@"
+
+#endif // CHROMECAST_COMMON_VERSION_INFO_H_
diff --git a/chromecast/shell/common/cast_content_client.cc b/chromecast/shell/common/cast_content_client.cc
index a09ec45..65d50ec 100644
--- a/chromecast/shell/common/cast_content_client.cc
+++ b/chromecast/shell/common/cast_content_client.cc
@@ -4,6 +4,7 @@
#include "chromecast/shell/common/cast_content_client.h"
+#include "chromecast/common/version.h"
#include "content/public/common/user_agent.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -11,13 +12,9 @@
namespace chromecast {
namespace shell {
-// TODO(lcwu): http://crbug.com/391080. Create the actual Chromecast
-// product version string and hook it up here.
-#define PRODUCT_VERSION "0.0.0.0"
-
std::string GetUserAgent() {
std::string product = "Chrome/" PRODUCT_VERSION;
- return content::BuildUserAgentFromProduct(product);
+ return content::BuildUserAgentFromProduct(product) + " CrKey";
}
CastContentClient::~CastContentClient() {