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:
chromecast
@ -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
|
||||
}
|
||||
|
12
chromecast/common/version.h.in
Normal file
12
chromecast/common/version.h.in
Normal file
@ -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() {
|
||||
|
Reference in New Issue
Block a user