0

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
This commit is contained in:
gunsch@chromium.org
2014-07-31 16:43:19 +00:00
parent f9c8c7c73e
commit d345593ff7
3 changed files with 47 additions and 5 deletions

@ -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
}

@ -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_

@ -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() {