summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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() {